From f9738a6262884c50504d51475f4d239d57427e99 Mon Sep 17 00:00:00 2001 From: "Jose Luis Vazquez Gonzalez (Jose Vazquez)" Date: Mon, 19 Dec 2016 18:11:33 +0100 Subject: Import patches-unapplied version 2.1.5-0ubuntu5 to ubuntu/zesty-proposed Imported using git-ubuntu import. Changelog parent: 7cf8cac21ab6430bd1656c5d4ca1c63d72e1b960 New changelog entries: * debian/patches/lp-1650522-reenable-auto-update.patch: - Enable AutoUpdate again at config/ubuntu/waagent.conf (LP: #1650522) --- debian/changelog | 7 +++++++ debian/patches/lp-1650522-reenable-auto-update.patch | 20 ++++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 28 insertions(+) create mode 100644 debian/patches/lp-1650522-reenable-auto-update.patch diff --git a/debian/changelog b/debian/changelog index ea06584..6f5fd83 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +walinuxagent (2.1.5-0ubuntu5) zesty; urgency=medium + + * debian/patches/lp-1650522-reenable-auto-update.patch: + - Enable AutoUpdate again at config/ubuntu/waagent.conf (LP: #1650522) + + -- Jose Luis Vazquez Gonzalez (Jose Vazquez) Mon, 19 Dec 2016 18:11:33 +0100 + walinuxagent (2.1.5-0ubuntu4) yakkety; urgency=medium * d/patches/fix-auto-update.patch: diff --git a/debian/patches/lp-1650522-reenable-auto-update.patch b/debian/patches/lp-1650522-reenable-auto-update.patch new file mode 100644 index 0000000..576e54c --- /dev/null +++ b/debian/patches/lp-1650522-reenable-auto-update.patch @@ -0,0 +1,20 @@ +Description: re-enable AutoUpdate at waagent.conf + After having disabled AutoUpdates it was agreed with Azure that + the ubuntu package was required to re-enable them by default. +Author: Jose Vazquez +Origin: upstream +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1650522 +Forwarded: not-needed +Last-Update: 2016-12-16 + +Index: walinuxagent-2.1.5/config/ubuntu/waagent.conf +=================================================================== +--- walinuxagent-2.1.5.orig/config/ubuntu/waagent.conf ++++ walinuxagent-2.1.5/config/ubuntu/waagent.conf +@@ -82,5 +82,5 @@ OS.OpensslPath=None + # OS.EnableRDMA=y + + # Enable or disable self-update, default is enabled +-AutoUpdate.Enabled=n ++AutoUpdate.Enabled=y + AutoUpdate.GAFamily=Prod diff --git a/debian/patches/series b/debian/patches/series index bc0bd89..dc77cc2 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -4,3 +4,4 @@ disable_import_test.patch disable_udev_overrides.patch lp1623570-adjust-walinuxagent-service-after-and-wants.patch fix-auto-update.patch +lp-1650522-reenable-auto-update.patch -- cgit v1.2.3 From ecb9bedea1db77ec17e927ed2734bce70da39b0d Mon Sep 17 00:00:00 2001 From: "Jose Luis Vazquez Gonzalez (Jose Vazquez)" Date: Mon, 19 Dec 2016 18:11:33 +0100 Subject: disable-auto-update.patch No DEP3 Subject or Description header found Gbp-Pq: disable-auto-update.patch. --- config/ubuntu/waagent.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/ubuntu/waagent.conf b/config/ubuntu/waagent.conf index ca68044..cb31824 100644 --- a/config/ubuntu/waagent.conf +++ b/config/ubuntu/waagent.conf @@ -82,5 +82,5 @@ OS.OpensslPath=None # OS.EnableRDMA=y # Enable or disable self-update, default is enabled -AutoUpdate.Enabled=y +AutoUpdate.Enabled=n AutoUpdate.GAFamily=Prod -- cgit v1.2.3 From afc2623445d36c7c1f6a670c72df603da7dad148 Mon Sep 17 00:00:00 2001 From: "Jose Luis Vazquez Gonzalez (Jose Vazquez)" Date: Mon, 19 Dec 2016 18:11:33 +0100 Subject: cloud-init-default-cfg.patch No DEP3 Subject or Description header found Gbp-Pq: cloud-init-default-cfg.patch. --- config/91_walinuxagent.cfg | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 config/91_walinuxagent.cfg diff --git a/config/91_walinuxagent.cfg b/config/91_walinuxagent.cfg new file mode 100644 index 0000000..b7049fc --- /dev/null +++ b/config/91_walinuxagent.cfg @@ -0,0 +1,3 @@ +# This configuration file is provided by the WALinuxAgent package. +datasource_list: [ Azure ] + -- cgit v1.2.3 From 1c7223d5da16e7fe2e278c44d00aeb34196a7f89 Mon Sep 17 00:00:00 2001 From: "Jose Luis Vazquez Gonzalez (Jose Vazquez)" Date: Mon, 19 Dec 2016 18:11:33 +0100 Subject: disable_import_test.patch No DEP3 Subject or Description header found Gbp-Pq: disable_import_test.patch. --- config/waagent.conf | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/config/waagent.conf b/config/waagent.conf index c28a651..655a9f2 100644 --- a/config/waagent.conf +++ b/config/waagent.conf @@ -14,13 +14,13 @@ Role.ConfigurationConsumer=None Role.TopologyConsumer=None # Enable instance creation -Provisioning.Enabled=y +Provisioning.Enabled=n # Password authentication for root account will be unavailable. -Provisioning.DeleteRootPassword=y +Provisioning.DeleteRootPassword=n # Generate fresh host key pair. -Provisioning.RegenerateSshHostKeyPair=y +Provisioning.RegenerateSshHostKeyPair=n # Supported values are "rsa", "dsa" and "ecdsa". Provisioning.SshHostKeyPairType=rsa @@ -44,14 +44,14 @@ Provisioning.ExecuteCustomData=n Provisioning.AllowResetSysUser=n # Format if unformatted. If 'n', resource disk will not be mounted. -ResourceDisk.Format=y +ResourceDisk.Format=n # File system on the resource disk # Typically ext3 or ext4. FreeBSD images should use 'ufs2' here. ResourceDisk.Filesystem=ext4 # Mount point for the resource disk -ResourceDisk.MountPoint=/mnt/resource +ResourceDisk.MountPoint=/mnt # Create and use swapfile on resource disk. ResourceDisk.EnableSwap=n -- cgit v1.2.3 From 3344c23a3776d77e9463b115a156f33d77a00e81 Mon Sep 17 00:00:00 2001 From: "Jose Luis Vazquez Gonzalez (Jose Vazquez)" Date: Mon, 19 Dec 2016 18:11:33 +0100 Subject: disable_udev_overrides.patch No DEP3 Subject or Description header found Gbp-Pq: disable_udev_overrides.patch. --- bin/waagent2.0 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bin/waagent2.0 b/bin/waagent2.0 index abc4448..8563554 100644 --- a/bin/waagent2.0 +++ b/bin/waagent2.0 @@ -95,8 +95,7 @@ ExtensionChildren = [] VMM_STARTUP_SCRIPT_NAME='install' VMM_CONFIG_FILE_NAME='linuxosconfiguration.xml' global RulesFiles -RulesFiles = [ "/lib/udev/rules.d/75-persistent-net-generator.rules", - "/etc/udev/rules.d/70-persistent-net.rules" ] +RulesFiles = [ ] VarLibDhcpDirectories = ["/var/lib/dhclient", "/var/lib/dhcpcd", "/var/lib/dhcp"] EtcDhcpClientConfFiles = ["/etc/dhcp/dhclient.conf", "/etc/dhcp3/dhclient.conf"] global LibDir -- cgit v1.2.3 From cc919bdf975f35092f0e85fc301d5661eb661986 Mon Sep 17 00:00:00 2001 From: "Jose Luis Vazquez Gonzalez (Jose Vazquez)" Date: Mon, 19 Dec 2016 18:11:33 +0100 Subject: walinuxagent.service: adjust Wants and After Gbp-Pq: lp1623570-adjust-walinuxagent-service-after-and-wants.patch. --- init/ubuntu/walinuxagent.service | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init/ubuntu/walinuxagent.service b/init/ubuntu/walinuxagent.service index ae8dccb..3cf47c5 100755 --- a/init/ubuntu/walinuxagent.service +++ b/init/ubuntu/walinuxagent.service @@ -7,8 +7,8 @@ [Unit] Description=Azure Linux Agent -After=network-online.target cloud-final.service -Wants=network-online.target sshd.service sshd-keygen.service cloud-final.service +After=network-online.target cloud-init.service +Wants=network-online.target sshd.service sshd-keygen.service ConditionFileIsExecutable=/usr/sbin/waagent ConditionPathExists=/etc/waagent.conf -- cgit v1.2.3 From 7b69971ddad188fe3de1303f15dc7e87ebbcd0fb Mon Sep 17 00:00:00 2001 From: "Jose Luis Vazquez Gonzalez (Jose Vazquez)" Date: Mon, 19 Dec 2016 18:11:33 +0100 Subject: Fix potential infinite loop in agent updating Gbp-Pq: fix-auto-update.patch. --- azurelinuxagent/ga/update.py | 15 +++++++-------- tests/ga/test_update.py | 10 ++++++---- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/azurelinuxagent/ga/update.py b/azurelinuxagent/ga/update.py index e89608a..0541ca3 100644 --- a/azurelinuxagent/ga/update.py +++ b/azurelinuxagent/ga/update.py @@ -379,14 +379,13 @@ class UpdateHandler(object): """ Load all non-blacklisted agents currently on disk. """ - if len(self.agents) <= 0: - try: - path = os.path.join(conf.get_lib_dir(), "{0}-*".format(AGENT_NAME)) - self._set_agents([GuestAgent(path=agent_dir) - for agent_dir in glob.iglob(path) if os.path.isdir(agent_dir)]) - self._filter_blacklisted_agents() - except Exception as e: - logger.warn(u"Exception occurred loading available agents: {0}", ustr(e)) + try: + path = os.path.join(conf.get_lib_dir(), "{0}-*".format(AGENT_NAME)) + self._set_agents([GuestAgent(path=agent_dir) + for agent_dir in glob.iglob(path) if os.path.isdir(agent_dir)]) + self._filter_blacklisted_agents() + except Exception as e: + logger.warn(u"Exception occurred loading available agents: {0}", ustr(e)) return def _purge_agents(self): diff --git a/tests/ga/test_update.py b/tests/ga/test_update.py index 74804fb..89fe95d 100644 --- a/tests/ga/test_update.py +++ b/tests/ga/test_update.py @@ -797,14 +797,14 @@ class TestUpdate(UpdateTestCase): self.assertEqual(len(get_agents(self.tmp_dir)), len(self.update_handler.agents)) return - def test_load_agents_does_not_reload(self): + def test_load_agents_does_reload(self): self.prepare_agents() self.update_handler._load_agents() agents = self.update_handler.agents self.update_handler._load_agents() - self.assertEqual(agents, self.update_handler.agents) + self.assertNotEqual(agents, self.update_handler.agents) return def test_load_agents_sorts(self): @@ -945,7 +945,8 @@ class TestUpdate(UpdateTestCase): self.assertEqual(0.0, latest_agent.error.last_failure) self.assertEqual(0, latest_agent.error.failure_count) - self._test_run_latest(mock_child=ChildMock(return_value=1)) + with patch('azurelinuxagent.ga.update.UpdateHandler.get_latest_agent', return_value=latest_agent): + self._test_run_latest(mock_child=ChildMock(return_value=1)) self.assertTrue(latest_agent.is_available) self.assertNotEqual(0.0, latest_agent.error.last_failure) @@ -961,7 +962,8 @@ class TestUpdate(UpdateTestCase): self.assertEqual(0.0, latest_agent.error.last_failure) self.assertEqual(0, latest_agent.error.failure_count) - self._test_run_latest(mock_child=ChildMock(side_effect=Exception("Force blacklisting"))) + with patch('azurelinuxagent.ga.update.UpdateHandler.get_latest_agent', return_value=latest_agent): + self._test_run_latest(mock_child=ChildMock(side_effect=Exception("Force blacklisting"))) self.assertFalse(latest_agent.is_available) self.assertTrue(latest_agent.error.is_blacklisted) -- cgit v1.2.3 From da4ceb800d17672277a1e77b61e8a22d55122e3b Mon Sep 17 00:00:00 2001 From: "Jose Luis Vazquez Gonzalez (Jose Vazquez)" Date: Mon, 19 Dec 2016 18:11:33 +0100 Subject: re-enable AutoUpdate at waagent.conf Gbp-Pq: lp-1650522-reenable-auto-update.patch. --- config/ubuntu/waagent.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/ubuntu/waagent.conf b/config/ubuntu/waagent.conf index cb31824..ca68044 100644 --- a/config/ubuntu/waagent.conf +++ b/config/ubuntu/waagent.conf @@ -82,5 +82,5 @@ OS.OpensslPath=None # OS.EnableRDMA=y # Enable or disable self-update, default is enabled -AutoUpdate.Enabled=n +AutoUpdate.Enabled=y AutoUpdate.GAFamily=Prod -- cgit v1.2.3