function names fixed according to PEP 8 standards

This commit is contained in:
Volkan Şahin 2016-07-18 18:16:37 +03:00
parent 80beb37e08
commit 1e35065b95
5 changed files with 9 additions and 8 deletions

View file

@ -101,7 +101,7 @@ class ExecutionManager(object):
except Exception as e: except Exception as e:
self.logger.error('[ExecutionManager] Could not remove temp file. Error Message: {}'.format(str(e))) self.logger.error('[ExecutionManager] Could not remove temp file. Error Message: {}'.format(str(e)))
self.plugin_manager.loadSinglePlugin(plugin_name) self.plugin_manager.load_single_plugin(plugin_name)
except Exception as e: except Exception as e:
self.logger.error('[ExecutionManager] A problem occurred while installing new Ahenk plugin. Error Message:{}'.format(str(e))) self.logger.error('[ExecutionManager] A problem occurred while installing new Ahenk plugin. Error Message:{}'.format(str(e)))

View file

@ -70,7 +70,7 @@ class Plugin(threading.Thread):
if obj_name == "TASK": if obj_name == "TASK":
self.logger.debug('[Plugin] Executing task') self.logger.debug('[Plugin] Executing task')
command = Scope.getInstance().getPluginManager().findCommand(self.getName(), item_obj.get_command_cls_id().lower()) command = Scope.getInstance().getPluginManager().find_command(self.getName(), item_obj.get_command_cls_id().lower())
self.context.put('task_id', item_obj.get_command_cls_id().lower()) self.context.put('task_id', item_obj.get_command_cls_id().lower())
task_data = item_obj.get_parameter_map() task_data = item_obj.get_parameter_map()
@ -112,7 +112,7 @@ class Plugin(threading.Thread):
self.logger.debug('[Plugin] Executing profile') self.logger.debug('[Plugin] Executing profile')
profile_data = item_obj.get_profile_data() profile_data = item_obj.get_profile_data()
policy_module = Scope.getInstance().getPluginManager().findPolicyModule(item_obj.get_plugin().get_name()) policy_module = Scope.getInstance().getPluginManager().find_policy_module(item_obj.get_plugin().get_name())
self.context.put('username', item_obj.get_username()) self.context.put('username', item_obj.get_username())
execution_id = self.get_execution_id(item_obj.get_id()) execution_id = self.get_execution_id(item_obj.get_id())

View file

@ -4,8 +4,9 @@
from base.plugin.plugin_manager import PluginManager from base.plugin.plugin_manager import PluginManager
class PluginManagerFactory(object):
class PluginManagerFactory(object):
def get_instance(): def get_instance():
return PluginManager() return PluginManager()
get_instance = staticmethod(get_instance) get_instance = staticmethod(get_instance)

View file

@ -30,7 +30,7 @@ class ScheduleTaskJob(object):
def process_task(self): def process_task(self):
try: try:
self.logger.debug('[ScheduleTaskJob] Running scheduled task now...') self.logger.debug('[ScheduleTaskJob] Running scheduled task now...')
self.plugin_manager.processTask(self.task) self.plugin_manager.process_task(self.task)
self.logger.debug('[ScheduleTaskJob] Scheduled Task was executed.') self.logger.debug('[ScheduleTaskJob] Scheduled Task was executed.')
if self.is_single_shot(): if self.is_single_shot():
Scope.getInstance().get_scheduler().remove_job(self.task.get_id()) Scope.getInstance().get_scheduler().remove_job(self.task.get_id())

View file

@ -23,7 +23,7 @@ class TaskManager(object):
self.saveTask(task) self.saveTask(task)
if task.get_cron_str() is None or task.get_cron_str() == '': if task.get_cron_str() is None or task.get_cron_str() == '':
self.logger.debug('[TaskManager] Adding task ... ') self.logger.debug('[TaskManager] Adding task ... ')
self.pluginManager.processTask(task) self.pluginManager.process_task(task)
else: else:
self.scheduler.save_and_add_job(task) self.scheduler.save_and_add_job(task)
@ -32,7 +32,7 @@ class TaskManager(object):
def addPolicy(self, policy): def addPolicy(self, policy):
try: try:
self.pluginManager.processPolicy(policy) self.pluginManager.process_policy(policy)
except Exception as e: except Exception as e:
self.logger.error("[TaskManager] Exception occurred when adding policy. Error Message: {}".format(str(e))) self.logger.error("[TaskManager] Exception occurred when adding policy. Error Message: {}".format(str(e)))