|
|
@@ -1,7 +1,7 @@
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# spec file for package python-azure-agent
|
|
|
|
# spec file for package python-azure-agent
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# Copyright (c) 2023 SUSE LLC
|
|
|
|
# Copyright (c) 2024 SUSE LLC
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
@@ -31,12 +31,14 @@ Patch8: paa_12_sp5_rdma_no_ext_driver.patch
|
|
|
|
# PATCH-FIX-UPSTREAM gh#Azure/WALinuxAgent#2741
|
|
|
|
# PATCH-FIX-UPSTREAM gh#Azure/WALinuxAgent#2741
|
|
|
|
Patch9: remove-mock.patch
|
|
|
|
Patch9: remove-mock.patch
|
|
|
|
Patch10: agent-micro-is-sles.patch
|
|
|
|
Patch10: agent-micro-is-sles.patch
|
|
|
|
|
|
|
|
# PATCH-FIX-UPSTREAM gh#Azure/WALinuxAgent#3158
|
|
|
|
|
|
|
|
Patch11: agent-btrfs-use-f.patch
|
|
|
|
BuildRequires: dos2unix
|
|
|
|
BuildRequires: dos2unix
|
|
|
|
|
|
|
|
|
|
|
|
BuildRequires: distribution-release
|
|
|
|
BuildRequires: distribution-release
|
|
|
|
BuildRequires: openssl
|
|
|
|
BuildRequires: openssl
|
|
|
|
BuildRequires: python-rpm-macros
|
|
|
|
BuildRequires: python-rpm-macros
|
|
|
|
%if 0%{?suse_version} && 0%{?suse_version} > 1315
|
|
|
|
%if 0%{?suse_version} > 1315
|
|
|
|
BuildRequires: python3-distro
|
|
|
|
BuildRequires: python3-distro
|
|
|
|
BuildRequires: python3-setuptools
|
|
|
|
BuildRequires: python3-setuptools
|
|
|
|
%else
|
|
|
|
%else
|
|
|
@@ -56,7 +58,7 @@ Requires: sysvinit-tools
|
|
|
|
%if 0%{?suse_version} && 0%{?suse_version} <= 1500
|
|
|
|
%if 0%{?suse_version} && 0%{?suse_version} <= 1500
|
|
|
|
Requires: wicked
|
|
|
|
Requires: wicked
|
|
|
|
%endif
|
|
|
|
%endif
|
|
|
|
%if 0%{?suse_version} && 0%{?suse_version} > 1315
|
|
|
|
%if 0%{?suse_version} > 1315
|
|
|
|
Requires: python3-distro
|
|
|
|
Requires: python3-distro
|
|
|
|
Requires: python3-pyasn1
|
|
|
|
Requires: python3-pyasn1
|
|
|
|
Requires: python3-xml
|
|
|
|
Requires: python3-xml
|
|
|
@@ -102,7 +104,7 @@ Summary: Default upstream configuration
|
|
|
|
Group: Development/Languages/Python
|
|
|
|
Group: Development/Languages/Python
|
|
|
|
Requires: %{name} == %{version}
|
|
|
|
Requires: %{name} == %{version}
|
|
|
|
Provides: waagent-config
|
|
|
|
Provides: waagent-config
|
|
|
|
Conflicts: otherproviders(waagent-config)
|
|
|
|
Conflicts: waagent-config
|
|
|
|
|
|
|
|
|
|
|
|
%description config-default
|
|
|
|
%description config-default
|
|
|
|
The default configuration for the agent as supplied by upstream for SUSE
|
|
|
|
The default configuration for the agent as supplied by upstream for SUSE
|
|
|
@@ -112,7 +114,7 @@ Summary: SUSE specific configuration for server products
|
|
|
|
Group: Development/Languages/Python
|
|
|
|
Group: Development/Languages/Python
|
|
|
|
Requires: %{name} == %{version}
|
|
|
|
Requires: %{name} == %{version}
|
|
|
|
Provides: waagent-config
|
|
|
|
Provides: waagent-config
|
|
|
|
Conflicts: otherproviders(waagent-config)
|
|
|
|
Conflicts: waagent-config
|
|
|
|
|
|
|
|
|
|
|
|
%description config-server
|
|
|
|
%description config-server
|
|
|
|
Modified waagent.conf file to meet SUSE policies and SUSE image build
|
|
|
|
Modified waagent.conf file to meet SUSE policies and SUSE image build
|
|
|
@@ -123,7 +125,7 @@ Summary: SUSE specific configuration for HPC
|
|
|
|
Group: Development/Languages/Python
|
|
|
|
Group: Development/Languages/Python
|
|
|
|
Requires: %{name} == %{version}
|
|
|
|
Requires: %{name} == %{version}
|
|
|
|
Provides: waagent-config
|
|
|
|
Provides: waagent-config
|
|
|
|
Conflicts: otherproviders(waagent-config)
|
|
|
|
Conflicts: waagent-config
|
|
|
|
|
|
|
|
|
|
|
|
%description config-hpc
|
|
|
|
%description config-hpc
|
|
|
|
Modified waagent.conf file to meet SUSE policies and SUSE image build
|
|
|
|
Modified waagent.conf file to meet SUSE policies and SUSE image build
|
|
|
@@ -134,7 +136,7 @@ Summary: SUSE specific configuration for Micro
|
|
|
|
Group: Development/Languages/Python
|
|
|
|
Group: Development/Languages/Python
|
|
|
|
Requires: %{name} == %{version}
|
|
|
|
Requires: %{name} == %{version}
|
|
|
|
Provides: waagent-config
|
|
|
|
Provides: waagent-config
|
|
|
|
Conflicts: otherproviders(waagent-config)
|
|
|
|
Conflicts: waagent-config
|
|
|
|
|
|
|
|
|
|
|
|
%description config-micro
|
|
|
|
%description config-micro
|
|
|
|
Modified waagent.conf file to meet SUSE policies and SUSE image build
|
|
|
|
Modified waagent.conf file to meet SUSE policies and SUSE image build
|
|
|
@@ -143,24 +145,26 @@ setup
|
|
|
|
%prep
|
|
|
|
%prep
|
|
|
|
%setup -qn WALinuxAgent-%{version}
|
|
|
|
%setup -qn WALinuxAgent-%{version}
|
|
|
|
%patch -P 1
|
|
|
|
%patch -P 1
|
|
|
|
%if 0%{?suse_version} && 0%{?suse_version} > 1315 && 0%{?sle_version}
|
|
|
|
%if 0%{?suse_version} > 1315
|
|
|
|
%patch -P 6
|
|
|
|
%patch -P 6
|
|
|
|
%endif
|
|
|
|
%endif
|
|
|
|
%patch -P 7
|
|
|
|
%patch -P 7
|
|
|
|
%patch -P 8
|
|
|
|
%patch -P 8
|
|
|
|
%patch -P 9 -p1
|
|
|
|
%patch -P 9 -p1
|
|
|
|
%patch -P 10
|
|
|
|
%patch -P 10
|
|
|
|
|
|
|
|
%patch -P 11
|
|
|
|
|
|
|
|
|
|
|
|
%build
|
|
|
|
%build
|
|
|
|
%if 0%{?suse_version} && 0%{?suse_version} > 1315
|
|
|
|
%if 0%{?suse_version} > 1315
|
|
|
|
python3 setup.py build
|
|
|
|
python3 setup.py build
|
|
|
|
%else
|
|
|
|
%else
|
|
|
|
python setup.py build
|
|
|
|
python setup.py build
|
|
|
|
%endif
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
|
|
%install
|
|
|
|
%install
|
|
|
|
%if 0%{?suse_version} && 0%{?suse_version} > 1315
|
|
|
|
%if 0%{?suse_version} > 1315
|
|
|
|
python3 setup.py install --prefix=%{_prefix} --lnx-distro='suse' --root=%{buildroot}
|
|
|
|
python3 setup.py install --prefix=%{_prefix} --lnx-distro='suse' --root=%{buildroot}
|
|
|
|
|
|
|
|
rm %{buildroot}/usr/sbin/waagent2.0
|
|
|
|
%else
|
|
|
|
%else
|
|
|
|
python setup.py install --prefix=%{_prefix} --lnx-distro='suse' --root=%{buildroot}
|
|
|
|
python setup.py install --prefix=%{_prefix} --lnx-distro='suse' --root=%{buildroot}
|
|
|
|
%endif
|
|
|
|
%endif
|
|
|
@@ -185,8 +189,10 @@ cp %{buildroot}%{_sysconfdir}/waagent.conf %{buildroot}%{_sysconfdir}/waagent.co
|
|
|
|
# Micro setup
|
|
|
|
# Micro setup
|
|
|
|
# Undo the HPC change
|
|
|
|
# Undo the HPC change
|
|
|
|
sed -i -e "s/OS.EnableRDMA=y/# OS.EnableRDMA=y/" %{buildroot}%{_sysconfdir}/waagent.conf
|
|
|
|
sed -i -e "s/OS.EnableRDMA=y/# OS.EnableRDMA=y/" %{buildroot}%{_sysconfdir}/waagent.conf
|
|
|
|
# Use Ignition/Afterburn in Micro
|
|
|
|
%if 0%{?sle_version} && 0%{?sle_version} < 150500
|
|
|
|
|
|
|
|
# Use Ignition/Afterburn in Micro < 5.5
|
|
|
|
sed -i -e "s/Provisioning.Agent=cloud-init/Provisioning.Agent=disabled/" %{buildroot}%{_sysconfdir}/waagent.conf
|
|
|
|
sed -i -e "s/Provisioning.Agent=cloud-init/Provisioning.Agent=disabled/" %{buildroot}%{_sysconfdir}/waagent.conf
|
|
|
|
|
|
|
|
%endif
|
|
|
|
# No extension support for transactional-upfdate systems
|
|
|
|
# No extension support for transactional-upfdate systems
|
|
|
|
# There's an inherant bug in that root password reset is also treated via this
|
|
|
|
# There's an inherant bug in that root password reset is also treated via this
|
|
|
|
# switch
|
|
|
|
# switch
|
|
|
@@ -213,8 +219,6 @@ mv %{buildroot}%{_sysconfdir}/udev/rules.d/* %{buildroot}/usr/lib/udev/rules.d/
|
|
|
|
### log file ghost
|
|
|
|
### log file ghost
|
|
|
|
mkdir -p %{buildroot}/%{_localstatedir}/log
|
|
|
|
mkdir -p %{buildroot}/%{_localstatedir}/log
|
|
|
|
touch %{buildroot}/%{_localstatedir}/log/waagent.log
|
|
|
|
touch %{buildroot}/%{_localstatedir}/log/waagent.log
|
|
|
|
### permissinon fixes
|
|
|
|
|
|
|
|
chmod +x %{buildroot}/%{_sbindir}/waagent2.0
|
|
|
|
|
|
|
|
### naming issues
|
|
|
|
### naming issues
|
|
|
|
%if 0%{?suse_version} > 1500
|
|
|
|
%if 0%{?suse_version} > 1500
|
|
|
|
mkdir -p %{buildroot}%{_distconfdir}/logrotate.d
|
|
|
|
mkdir -p %{buildroot}%{_distconfdir}/logrotate.d
|
|
|
@@ -224,7 +228,7 @@ mv %{buildroot}/%{_sysconfdir}/logrotate.d/waagent.logrotate %{buildroot}/%{_sys
|
|
|
|
%endif
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
|
|
# install tests
|
|
|
|
# install tests
|
|
|
|
%if 0%{?suse_version} && 0%{?suse_version} > 1315
|
|
|
|
%if 0%{?suse_version} > 1315
|
|
|
|
cp -r tests %{buildroot}/%{python3_sitelib}/azurelinuxagent
|
|
|
|
cp -r tests %{buildroot}/%{python3_sitelib}/azurelinuxagent
|
|
|
|
%else
|
|
|
|
%else
|
|
|
|
cp -r tests %{buildroot}/%{python_sitelib}/azurelinuxagent
|
|
|
|
cp -r tests %{buildroot}/%{python_sitelib}/azurelinuxagent
|
|
|
@@ -232,6 +236,13 @@ cp -r tests %{buildroot}/%{python_sitelib}/azurelinuxagent
|
|
|
|
|
|
|
|
|
|
|
|
%pre
|
|
|
|
%pre
|
|
|
|
%service_add_pre waagent.service
|
|
|
|
%service_add_pre waagent.service
|
|
|
|
|
|
|
|
# Handle the case when the -config-* package is not installed, we want to
|
|
|
|
|
|
|
|
# preserver the previousl config file that was flavor customized during
|
|
|
|
|
|
|
|
# image build
|
|
|
|
|
|
|
|
if [ -e /etc/waagent.conf ]; then
|
|
|
|
|
|
|
|
cp -Z /etc/waagent.conf /etc/waagent.conf.bak
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
%if 0%{?suse_version} > 1500
|
|
|
|
%if 0%{?suse_version} > 1500
|
|
|
|
# Prepare for migration to /usr/etc; save any old .rpmsave
|
|
|
|
# Prepare for migration to /usr/etc; save any old .rpmsave
|
|
|
|
for i in logrotate.d/waagent ; do
|
|
|
|
for i in logrotate.d/waagent ; do
|
|
|
@@ -239,11 +250,28 @@ for i in logrotate.d/waagent ; do
|
|
|
|
done
|
|
|
|
done
|
|
|
|
%endif
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
|
|
%if 0%{?suse_version} > 1500
|
|
|
|
|
|
|
|
%posttrans
|
|
|
|
%posttrans
|
|
|
|
|
|
|
|
# Do not clobber the config if it was installed from a config package, but
|
|
|
|
|
|
|
|
# put the oldfile back if we do not have another config file
|
|
|
|
|
|
|
|
if [ ! -e /etc/waagent.conf ]; then
|
|
|
|
|
|
|
|
if [ -e /etc/waagent.conf.bak ]; then
|
|
|
|
|
|
|
|
mv -Z /etc/waagent.conf.bak /etc/waagent.conf
|
|
|
|
|
|
|
|
#restart the waagent.service again the restert in post failed due
|
|
|
|
|
|
|
|
# to missing config
|
|
|
|
|
|
|
|
systemctl try-restart waagent.service
|
|
|
|
|
|
|
|
# Making the assumption that the rpmsave file was generated because of
|
|
|
|
|
|
|
|
# of the previously broken package upgrade.
|
|
|
|
|
|
|
|
elif [ -e /etc/waagent.conf.rpmsave ]; then
|
|
|
|
|
|
|
|
cp -Z /etc/waagent.conf.rpmsave /etc/waagent.conf
|
|
|
|
|
|
|
|
#restart the waagent.service again the restert in post failed due
|
|
|
|
|
|
|
|
# to missing config
|
|
|
|
|
|
|
|
systemctl try-restart waagent.service
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
%if 0%{?suse_version} > 1500
|
|
|
|
# Migration to /usr/etc, restore just created .rpmsave
|
|
|
|
# Migration to /usr/etc, restore just created .rpmsave
|
|
|
|
for i in logrotate.d/waagent ; do
|
|
|
|
for i in logrotate.d/waagent ; do
|
|
|
|
test -f %{_sysconfdir}/${i}.rpmsave && mv -v %{_sysconfdir}/${i}.rpmsave %{_sysconfdir}/${i} ||:
|
|
|
|
test -f %{_sysconfdir}/${i}.rpmsave && mv -v %{_sysconfdir}/${i}.rpmsave %{_sysconfdir}/${i} ||:
|
|
|
|
done
|
|
|
|
done
|
|
|
|
%endif
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
|
@@ -280,7 +308,6 @@ ln -s %{_sysconfdir}/waagent.conf.micro %{_sysconfdir}/waagent.conf
|
|
|
|
%exclude %{_sysconfdir}/waagent.conf*
|
|
|
|
%exclude %{_sysconfdir}/waagent.conf*
|
|
|
|
%{_sbindir}/rcwaagent
|
|
|
|
%{_sbindir}/rcwaagent
|
|
|
|
%attr(0755,root,root) %{_sbindir}/waagent
|
|
|
|
%attr(0755,root,root) %{_sbindir}/waagent
|
|
|
|
%attr(0755,root,root) %{_sbindir}/waagent2.0
|
|
|
|
|
|
|
|
%if 0%{?suse_version} > 1500
|
|
|
|
%if 0%{?suse_version} > 1500
|
|
|
|
%{_distconfdir}/logrotate.d/waagent
|
|
|
|
%{_distconfdir}/logrotate.d/waagent
|
|
|
|
%else
|
|
|
|
%else
|
|
|
@@ -295,19 +322,20 @@ ln -s %{_sysconfdir}/waagent.conf.micro %{_sysconfdir}/waagent.conf
|
|
|
|
/usr/lib/udev/rules.d/66-azure-storage.rules
|
|
|
|
/usr/lib/udev/rules.d/66-azure-storage.rules
|
|
|
|
/usr/lib/udev/rules.d/99-azure-product-uuid.rules
|
|
|
|
/usr/lib/udev/rules.d/99-azure-product-uuid.rules
|
|
|
|
%endif
|
|
|
|
%endif
|
|
|
|
%if 0%{?suse_version} && 0%{?suse_version} > 1315
|
|
|
|
%if 0%{?suse_version} > 1315
|
|
|
|
%dir %{python3_sitelib}/azurelinuxagent
|
|
|
|
%dir %{python3_sitelib}/azurelinuxagent
|
|
|
|
%{python3_sitelib}
|
|
|
|
%{python3_sitelib}
|
|
|
|
%exclude %{python3_sitelib}/azurelinuxagent/tests
|
|
|
|
%exclude %{python3_sitelib}/azurelinuxagent/tests
|
|
|
|
%else
|
|
|
|
%else
|
|
|
|
%dir %{python_sitelib}/azurelinuxagent
|
|
|
|
%dir %{python_sitelib}/azurelinuxagent
|
|
|
|
|
|
|
|
%attr(0755,root,root) %{_sbindir}/waagent2.0
|
|
|
|
%{python_sitelib}
|
|
|
|
%{python_sitelib}
|
|
|
|
%exclude %{python_sitelib}/azurelinuxagent/tests
|
|
|
|
%exclude %{python_sitelib}/azurelinuxagent/tests
|
|
|
|
%endif
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
|
|
%files test
|
|
|
|
%files test
|
|
|
|
%defattr(0644,root,root,0755)
|
|
|
|
%defattr(0644,root,root,0755)
|
|
|
|
%if 0%{?suse_version} && 0%{?suse_version} > 1315
|
|
|
|
%if 0%{?suse_version} > 1315
|
|
|
|
%{python3_sitelib}/azurelinuxagent/tests
|
|
|
|
%{python3_sitelib}/azurelinuxagent/tests
|
|
|
|
%else
|
|
|
|
%else
|
|
|
|
%{python_sitelib}/azurelinuxagent/tests
|
|
|
|
%{python_sitelib}/azurelinuxagent/tests
|
|
|
|