From 1e35065b956e16db46159f7db87c015dbb1bebe9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Volkan=20=C5=9Eahin?= Date: Mon, 18 Jul 2016 18:16:37 +0300 Subject: [PATCH] function names fixed according to PEP 8 standards --- opt/ahenk/base/execution/ExecutionManager.py | 2 +- opt/ahenk/base/plugin/Plugin.py | 4 ++-- opt/ahenk/base/plugin/plugin_manager_factory.py | 5 +++-- opt/ahenk/base/scheduler/custom/schedule_job.py | 2 +- opt/ahenk/base/task/TaskManager.py | 4 ++-- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/opt/ahenk/base/execution/ExecutionManager.py b/opt/ahenk/base/execution/ExecutionManager.py index a89bb1f..2ca5a4a 100644 --- a/opt/ahenk/base/execution/ExecutionManager.py +++ b/opt/ahenk/base/execution/ExecutionManager.py @@ -101,7 +101,7 @@ class ExecutionManager(object): except Exception as 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: self.logger.error('[ExecutionManager] A problem occurred while installing new Ahenk plugin. Error Message:{}'.format(str(e))) diff --git a/opt/ahenk/base/plugin/Plugin.py b/opt/ahenk/base/plugin/Plugin.py index 52a5f64..4d42726 100644 --- a/opt/ahenk/base/plugin/Plugin.py +++ b/opt/ahenk/base/plugin/Plugin.py @@ -70,7 +70,7 @@ class Plugin(threading.Thread): if obj_name == "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()) task_data = item_obj.get_parameter_map() @@ -112,7 +112,7 @@ class Plugin(threading.Thread): self.logger.debug('[Plugin] Executing profile') 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()) execution_id = self.get_execution_id(item_obj.get_id()) diff --git a/opt/ahenk/base/plugin/plugin_manager_factory.py b/opt/ahenk/base/plugin/plugin_manager_factory.py index 9e12aa3..5e77b35 100644 --- a/opt/ahenk/base/plugin/plugin_manager_factory.py +++ b/opt/ahenk/base/plugin/plugin_manager_factory.py @@ -4,8 +4,9 @@ from base.plugin.plugin_manager import PluginManager -class PluginManagerFactory(object): +class PluginManagerFactory(object): def get_instance(): return PluginManager() - get_instance = staticmethod(get_instance) \ No newline at end of file + + get_instance = staticmethod(get_instance) diff --git a/opt/ahenk/base/scheduler/custom/schedule_job.py b/opt/ahenk/base/scheduler/custom/schedule_job.py index 207c307..6ed7307 100644 --- a/opt/ahenk/base/scheduler/custom/schedule_job.py +++ b/opt/ahenk/base/scheduler/custom/schedule_job.py @@ -30,7 +30,7 @@ class ScheduleTaskJob(object): def process_task(self): try: 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.') if self.is_single_shot(): Scope.getInstance().get_scheduler().remove_job(self.task.get_id()) diff --git a/opt/ahenk/base/task/TaskManager.py b/opt/ahenk/base/task/TaskManager.py index 88cc5bf..b188f6c 100644 --- a/opt/ahenk/base/task/TaskManager.py +++ b/opt/ahenk/base/task/TaskManager.py @@ -23,7 +23,7 @@ class TaskManager(object): self.saveTask(task) if task.get_cron_str() is None or task.get_cron_str() == '': self.logger.debug('[TaskManager] Adding task ... ') - self.pluginManager.processTask(task) + self.pluginManager.process_task(task) else: self.scheduler.save_and_add_job(task) @@ -32,7 +32,7 @@ class TaskManager(object): def addPolicy(self, policy): try: - self.pluginManager.processPolicy(policy) + self.pluginManager.process_policy(policy) except Exception as e: self.logger.error("[TaskManager] Exception occurred when adding policy. Error Message: {}".format(str(e)))