Merge branch 'master' of github.com:Pardus-Kurumsal/ahenk

This commit is contained in:
İsmail Başaran 2016-03-14 13:44:05 +02:00
commit 683294f808
2 changed files with 4 additions and 17 deletions

View file

@ -16,6 +16,7 @@ class ExecutionManager(object):
scope = Scope.getInstance()
self.config_manager = scope.getConfigurationManager()
self.event_manager = scope.getEventManager()
self.logger=scope.getLogger()
self.event_manager.register_event('EXECUTE_TASK',self.execute_task)
self.event_manager.register_event('EXECUTE_SCRIPT',self.execute_script)
@ -32,7 +33,7 @@ class ExecutionManager(object):
#msg_id =str(j['id']).lower()
target_file_path =str(j['filepath']).lower()
file_name =str(j['filename']).lower()
self.logger.debug('[ExecutionManager] %s will be moved to %s' % file_name,target_file_path)
self.logger.debug('[ExecutionManager] '+file_name+' will be moved to '+target_file_path)
shutil.move(default_file_path+file_name,target_file_path+file_name)
def execute_script(self,arg):

View file

@ -31,12 +31,12 @@ class Registration():
def registration_request(self):
self.logger.debug('[Registration] Requesting registration')
message_sender=MessageSender(self.get_registration_request_message(),None)
message_sender=MessageSender(self.message_manager.registration_msg(),None)
message_sender.connect_to_server()
def ldap_registration_request(self):
self.logger.debug('[Registration] Requesting LDAP registration')
message_sender=MessageSender(self.get_ldap_registration_request_message(),None)
message_sender=MessageSender(self.message_manager.ldap_registration_msg(),None)
message_sender.connect_to_server()
def confirm_registration(self,reg_reply):
@ -84,20 +84,6 @@ class Registration():
else:
return False
def get_registration_request_message(self):
if self.conf_manager.has_section('REGISTRATION'):
return self.message_manager.registration_msg()
else:
self.logger.error('[Registration] Registration section not found while trying to registration request')
return None
def get_ldap_registration_request_message(self):
if self.conf_manager.has_section('REGISTRATION'):
return self.message_manager.ldap_registration_msg()
else:
self.logger.error('[Registration] Registration section not found while trying to ldap registration request')
return None
def register(self,uuid_depend_mac):
if self.conf_manager.has_section('REGISTRATION'):
self.logger.info('[Registration] Registration section is already created')