From 91b8b2e71f4388e2921cd914be1b965bb10deab0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tuncay=20=C3=87OLAK?= Date: Mon, 29 Mar 2021 10:49:56 +0300 Subject: [PATCH] Syncing /usr/share/ahenk to src and recreating ahenk.install --- .../ahenk/base/registration/registration.py | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/usr/share/ahenk/base/registration/registration.py b/usr/share/ahenk/base/registration/registration.py index f05accf..d374c8f 100644 --- a/usr/share/ahenk/base/registration/registration.py +++ b/usr/share/ahenk/base/registration/registration.py @@ -196,18 +196,28 @@ class Registration: def install_and_config_ad(self, reg_reply): self.logger.info('AD install process starting') + domain_name = str(reg_reply['adDomainName']) host_name = str(reg_reply['adHostName']) ip_address = str(reg_reply['adIpAddress']) password = str(reg_reply['adAdminPassword']) ad_username = str(reg_reply['adAdminUserName']) - dynamic_dns_update = reg_reply['dynamicDNSUpdate'] + dynamic_dns_update = False - if domain_name is None or host_name is None or ip_address is None or password is None : - self.logger.error("Registration params is null") - return - - self.ad_login.authenticate(domain_name, host_name, ip_address, password, ad_username, dynamic_dns_update) + if 'dynamicDNSUpdate' in reg_reply: + dynamic_dns_update = reg_reply['dynamicDNSUpdate'] + self.logger.info("DynamicDNSUpdate is NOT NULL") + if domain_name is None or host_name is None or ip_address is None or password is None: + self.logger.error("Registration params is null") + return + self.ad_login.authenticate(domain_name, host_name, ip_address, password, ad_username, dynamic_dns_update) + else: + self.logger.info("DynamicDNSUpdate is NULL") + if domain_name is None or host_name is None or ip_address is None or password is None: + self.logger.error("Registration params is null") + return + self.ad_login.authenticate(domain_name, host_name, ip_address, password, ad_username, dynamic_dns_update) + # self.ad_login.authenticate(domain_name, host_name, ip_address, password, ad_username, dynamic_dns_update) def registration_error(self, reg_reply): self.re_register()