diff options
author | Jose Luis Vazquez Gonzalez (Jose Vazquez) <jose.vazquez@canonical.com> | 2016-12-19 18:11:33 +0100 |
---|---|---|
committer | usd-importer <ubuntu-server@lists.ubuntu.com> | 2016-12-20 10:38:16 +0000 |
commit | 7b69971ddad188fe3de1303f15dc7e87ebbcd0fb (patch) | |
tree | 33217746d0c39496230f7b54753cad70c0b81125 /azurelinuxagent/ga/update.py | |
parent | cc919bdf975f35092f0e85fc301d5661eb661986 (diff) | |
download | vyos-walinuxagent-7b69971ddad188fe3de1303f15dc7e87ebbcd0fb.tar.gz vyos-walinuxagent-7b69971ddad188fe3de1303f15dc7e87ebbcd0fb.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.py | 15 |
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): |