check message file

This commit is contained in:
edip 2019-01-02 15:09:53 +03:00
parent 9fb167ebb3
commit bf304c9969
2 changed files with 21 additions and 1 deletions

View file

@ -97,6 +97,26 @@ class Registration:
print(e)
raise
def update_registration_attrs(self, dn=None):
self.logger.debug('Registration configuration is updating...')
self.db_service.update('registration', ['dn', 'registered'], [dn, 1], ' registered = 0')
if self.conf_manager.has_section('CONNECTION'):
self.conf_manager.set('CONNECTION', 'uid',
self.db_service.select_one_result('registration', 'jid', ' registered=1'))
self.conf_manager.set('CONNECTION', 'password',
self.db_service.select_one_result('registration', 'password', ' registered=1'))
if self.host and self.servicename:
self.conf_manager.set('CONNECTION', 'host', self.host)
self.conf_manager.set('CONNECTION', 'servicename', self.servicename)
# TODO get file path?
with open('/etc/ahenk/ahenk.conf', 'w') as configfile:
self.conf_manager.write(configfile)
self.logger.debug('Registration configuration file is updated')
def install_and_config_ldap(self, reg_reply):
self.logger.info('ldap install process starting')
server_address = str(reg_reply['ldapServer'])

View file

@ -340,7 +340,7 @@ class Util:
@staticmethod
def show_message(username,display=':0',message='', title=''):
ask_path = Util.get_ask_path_file()+ '/confirm.py'
ask_path = Util.get_ask_path_file()+ 'confirm.py'
try:
if username is not None: