summaryrefslogtreecommitdiff
path: root/azurelinuxagent/ga/update.py
diff options
context:
space:
mode:
authorDaniel Watkins <daniel.watkins@canonical.com>2016-10-04 12:25:07 +0100
committerusd-importer <ubuntu-server@lists.ubuntu.com>2016-10-04 20:58:53 +0000
commitb6b1cb56b856e786b3ef4f82d96bf7f7e170af77 (patch)
tree6c71d1b13dd770232ca91e0957c9bd6488270e50 /azurelinuxagent/ga/update.py
parent400ea11cee00e9314426ee03f548366766a1f49b (diff)
downloadvyos-walinuxagent-b6b1cb56b856e786b3ef4f82d96bf7f7e170af77.tar.gz
vyos-walinuxagent-b6b1cb56b856e786b3ef4f82d96bf7f7e170af77.zip
Fix potential infinite loop in agent updating
Gbp-Pq: fix-auto-update.patch.
Diffstat (limited to 'azurelinuxagent/ga/update.py')
-rw-r--r--azurelinuxagent/ga/update.py15
1 files changed, 7 insertions, 8 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):