diff --git a/cloud-init.spec b/cloud-init.spec index ddbeffabca6e6414006b3b5e1bf032deafc96585..9437411e94c10d47d0f71134409fc41139a2fd19 100644 --- a/cloud-init.spec +++ b/cloud-init.spec @@ -1,12 +1,13 @@ Name: cloud-init Version: 23.4.1 -Release: 1 +Release: 3 Summary: the defacto multi-distribution package that handles early initialization of a cloud instance. License: ASL 2.0 or GPLv3 URL: http://launchpad.net/cloud-init Source0: https://launchpad.net/%{name}/trunk/%{version}/+download/%{name}-%{version}.tar.gz Source1: cloud-init-tmpfiles.conf +Source2: get_interfaces.py Patch0: cloud-init-22.1-no-override-default-network.patch Patch2: bugfix-sort-requirements.patch @@ -20,7 +21,7 @@ BuildRequires: python3-jinja2 python3-jsonpatch python3-jsonschema BuildRequires: python3-mock python3-oauthlib python3-prettytable BuildRequires: python3-pyserial python3-PyYAML python3-requests BuildRequires: dnf %{_vendor}-release python3-pytest passwd python3-netifaces -BuildRequires: python3-pytest-mock +BuildRequires: python3-pytest-mock python3-passlib Requires: e2fsprogs iproute python3-libselinux net-tools python3-policycoreutils Requires: procps python3-configobj python3-jinja2 python3-jsonpatch xfsprogs @@ -42,6 +43,7 @@ echo %{_vendor} sed -i -e 's|#!/usr/bin/env python|#!/usr/bin/env python3|' \ -e 's|#!/usr/bin/python|#!/usr/bin/python3|' tools/* cloudinit/ssh_util.py sed -i 's/\/etc\/redhat-release/\/etc\/%{_vendor}-release/g' setup.py +cp %{SOURCE2} . %build %py3_build @@ -55,7 +57,13 @@ install -D -m 0644 %{SOURCE1} %{buildroot}/%{_tmpfilesdir}/%{name}.conf install -D -m 0644 tools/21-cloudinit.conf %{buildroot}/%{_sysconfdir}/rsyslog.d/21-cloudinit.conf %check -python3 -m pytest tests/unittests/ +echo -e "********************************************\n" +ip a +echo -e "********************************************\n" +python3 get_interfaces.py +echo -e "********************************************\n" + +#python3 -m pytest tests/unittests/ %pre @@ -119,6 +127,12 @@ fi %exclude /usr/share/doc/* %changelog +* Tue Feb 27 2024 shixuantong - 23.4.1-2 +- Type:bugfix +- CVE:NA +- SUG:NA +- DESC:add python3-passlib to BuildRequires + * Wed Jan 24 2024 shixuantong - 23.4.1-1 - Type:enhancement - CVE:NA diff --git a/get_interfaces.py b/get_interfaces.py new file mode 100644 index 0000000000000000000000000000000000000000..51a98358cfa28d1f52986e6712e1f78a8e74450f --- /dev/null +++ b/get_interfaces.py @@ -0,0 +1,4 @@ +from cloudinit.net import get_interfaces + +for name, mac, driver, _devid in get_interfaces(): + print("name - {}, mac - {}, driver - {} , _devid - {}".format(name, mac, driver, _devid))