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 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'azurelinuxagent/ga/update.py') 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): -- cgit v1.2.3