From 3d350cff3b012dd40968e83133f28c9410fd5716 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Volkan=20=C5=9Eahin?= Date: Mon, 8 Aug 2016 11:13:51 +0300 Subject: [PATCH] minor bug fix solved --- opt/ahenk/base/plugin/plugin_manager.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/opt/ahenk/base/plugin/plugin_manager.py b/opt/ahenk/base/plugin/plugin_manager.py index c19d540..600b9aa 100644 --- a/opt/ahenk/base/plugin/plugin_manager.py +++ b/opt/ahenk/base/plugin/plugin_manager.py @@ -183,17 +183,19 @@ class PluginManager(object): self.logger.info('[PluginManager] Working on Ahenk profiles...') for agent_profile in ahenk_profiles: same_plugin_profile = None - for usr_profile in user_profiles: - if usr_profile.plugin.name == agent_profile.plugin.name: - same_plugin_profile = usr_profile - if same_plugin_profile is not None: - if agent_profile.overridable.lower() == 'true': - self.logger.debug('[PluginManager] Agent profile of {0} plugin will not executed because of profile override rules.'.format(agent_profile.plugin.name)) - continue - else: - self.logger.warning('[PluginManager] User profile of {0} plugin will not executed because of profile override rules.'.format(agent_profile.plugin.name)) - user_profiles.remove(same_plugin_profile) + if user_profiles is not None: + for usr_profile in user_profiles: + if usr_profile.plugin.name == agent_profile.plugin.name: + same_plugin_profile = usr_profile + + if same_plugin_profile is not None: + if agent_profile.overridable.lower() == 'true': + self.logger.debug('[PluginManager] Agent profile of {0} plugin will not executed because of profile override rules.'.format(agent_profile.plugin.name)) + continue + else: + self.logger.warning('[PluginManager] User profile of {0} plugin will not executed because of profile override rules.'.format(agent_profile.plugin.name)) + user_profiles.remove(same_plugin_profile) agent_profile.set_username(None) self.process_profile(agent_profile)