mirror of
https://github.com/Pardus-LiderAhenk/ahenk
synced 2024-11-22 15:32:19 +03:00
bug fixes about parameters
This commit is contained in:
parent
dfd1d9b9cc
commit
77455de1dd
4 changed files with 7 additions and 3 deletions
|
@ -8,6 +8,7 @@ import os
|
||||||
import shutil
|
import shutil
|
||||||
import stat
|
import stat
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import ast
|
||||||
|
|
||||||
from base.Scope import Scope
|
from base.Scope import Scope
|
||||||
from base.model.Policy import Policy
|
from base.model.Policy import Policy
|
||||||
|
@ -66,6 +67,7 @@ class ExecutionManager(object):
|
||||||
plugin_args = [str(plugin.get_active()), str(plugin.get_create_date()), str(plugin.get_deleted()), str(plugin.get_description()), str(plugin.get_machine_oriented()), str(plugin.get_modify_date()), str(plugin.get_name()), str(plugin.get_policy_plugin()), str(plugin.get_user_oriented()), str(plugin.get_version())]
|
plugin_args = [str(plugin.get_active()), str(plugin.get_create_date()), str(plugin.get_deleted()), str(plugin.get_description()), str(plugin.get_machine_oriented()), str(plugin.get_modify_date()), str(plugin.get_name()), str(plugin.get_policy_plugin()), str(plugin.get_user_oriented()), str(plugin.get_version())]
|
||||||
plugin_id = self.db_service.update('plugin', plugin_columns, plugin_args)
|
plugin_id = self.db_service.update('plugin', plugin_columns, plugin_args)
|
||||||
|
|
||||||
|
|
||||||
profile_args = [str(ahenk_policy_id), str(profile.get_create_date()), str(profile.get_modify_date()), str(profile.get_label()), str(profile.get_description()), str(profile.get_overridable()), str(profile.get_active()), str(profile.get_deleted()), str(profile.get_profile_data()), plugin_id]
|
profile_args = [str(ahenk_policy_id), str(profile.get_create_date()), str(profile.get_modify_date()), str(profile.get_label()), str(profile.get_description()), str(profile.get_overridable()), str(profile.get_active()), str(profile.get_deleted()), str(profile.get_profile_data()), plugin_id]
|
||||||
self.db_service.update('profile', profile_columns, profile_args)
|
self.db_service.update('profile', profile_columns, profile_args)
|
||||||
|
|
||||||
|
@ -200,6 +202,7 @@ class ExecutionManager(object):
|
||||||
username = json_data['username']
|
username = json_data['username']
|
||||||
ahenk_prof_json_arr = json_data['agentPolicyProfiles']
|
ahenk_prof_json_arr = json_data['agentPolicyProfiles']
|
||||||
user_prof_json_arr = json_data['userPolicyProfiles']
|
user_prof_json_arr = json_data['userPolicyProfiles']
|
||||||
|
|
||||||
ahenk_prof_arr = []
|
ahenk_prof_arr = []
|
||||||
user_prof_arr = []
|
user_prof_arr = []
|
||||||
if ahenk_prof_json_arr is not None:
|
if ahenk_prof_json_arr is not None:
|
||||||
|
|
|
@ -72,7 +72,7 @@ class Plugin(threading.Thread):
|
||||||
policy_module = Scope.getInstance().getPluginManager().findPolicyModule(item_obj.get_plugin().get_name())
|
policy_module = Scope.getInstance().getPluginManager().findPolicyModule(item_obj.get_plugin().get_name())
|
||||||
self.context.put('username', item_obj.get_username())
|
self.context.put('username', item_obj.get_username())
|
||||||
policy_module.handle_policy(profile_data, self.context)
|
policy_module.handle_policy(profile_data, self.context)
|
||||||
#TODO Message Code keep
|
#TODO Message Code keep Set default message if not exist
|
||||||
response = Response(type=self.context.get('message_type'), id=item_obj.id, code=self.context.get('message_code'), message=self.context.get('message'), data=self.context.get('data'), content_type=self.context.get('content_type'), execution_id='get_execution_id')
|
response = Response(type=self.context.get('message_type'), id=item_obj.id, code=self.context.get('message_code'), message=self.context.get('message'), data=self.context.get('data'), content_type=self.context.get('content_type'), execution_id='get_execution_id')
|
||||||
#self.response_queue.put(self.messaging.response_msg(response)) #TODO DEBUG
|
#self.response_queue.put(self.messaging.response_msg(response)) #TODO DEBUG
|
||||||
Scope.getInstance().getMessager().send_direct_message(self.messaging.response_msg(response))#TODO REMOVE
|
Scope.getInstance().getMessager().send_direct_message(self.messaging.response_msg(response))#TODO REMOVE
|
||||||
|
@ -80,7 +80,6 @@ class Plugin(threading.Thread):
|
||||||
# Empty context for next use
|
# Empty context for next use
|
||||||
self.context.empty_data()
|
self.context.empty_data()
|
||||||
|
|
||||||
|
|
||||||
elif obj_name == "KILL_SIGNAL":
|
elif obj_name == "KILL_SIGNAL":
|
||||||
self.keep_run = False
|
self.keep_run = False
|
||||||
self.logger.debug('[Plugin] Killing queue ! Plugin Name : ' + str(self.name))
|
self.logger.debug('[Plugin] Killing queue ! Plugin Name : ' + str(self.name))
|
||||||
|
|
|
@ -101,6 +101,7 @@ class PluginManager(object):
|
||||||
|
|
||||||
if ahenk_profiles is not None:
|
if ahenk_profiles is not None:
|
||||||
for profile in ahenk_profiles:
|
for profile in ahenk_profiles:
|
||||||
|
profile.set_username(None)
|
||||||
self.process_profile(profile)
|
self.process_profile(profile)
|
||||||
|
|
||||||
if user_profiles is not None:
|
if user_profiles is not None:
|
||||||
|
|
|
@ -100,6 +100,7 @@ class PluginManager(object):
|
||||||
|
|
||||||
if ahenk_profiles is not None:
|
if ahenk_profiles is not None:
|
||||||
for profile in ahenk_profiles:
|
for profile in ahenk_profiles:
|
||||||
|
profile.set_username(None)
|
||||||
self.process_profile(profile)
|
self.process_profile(profile)
|
||||||
|
|
||||||
if user_profiles is not None:
|
if user_profiles is not None:
|
||||||
|
@ -110,7 +111,7 @@ class PluginManager(object):
|
||||||
def process_profile(self, profile):
|
def process_profile(self, profile):
|
||||||
try:
|
try:
|
||||||
plugin = profile.get_plugin()
|
plugin = profile.get_plugin()
|
||||||
plugin_name = plugin.name
|
plugin_name = plugin.get_name()
|
||||||
if plugin_name in self.pluginQueueDict:
|
if plugin_name in self.pluginQueueDict:
|
||||||
self.pluginQueueDict[plugin_name].put(profile, 1)
|
self.pluginQueueDict[plugin_name].put(profile, 1)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|
Loading…
Reference in a new issue