mirror of
https://github.com/Pardus-LiderAhenk/ahenk
synced 2024-11-25 20:32:20 +03:00
Active Directort domain bug fixed
This commit is contained in:
parent
063dbc04ac
commit
39f68f2283
2 changed files with 25 additions and 7 deletions
|
@ -53,7 +53,7 @@ class Logger(object):
|
|||
try:
|
||||
exc_type, exc_value, exc_trace_back = sys.exc_info()
|
||||
caller = getframeinfo(stack()[1][0])
|
||||
|
||||
message = message.decode("utf-8")
|
||||
if exc_type is None and exc_value is None and exc_trace_back is None:
|
||||
self.logger.error('[{0} {1}]\t {2}'.format(self.get_log_header(caller.filename), caller.lineno, message))
|
||||
else:
|
||||
|
|
|
@ -139,11 +139,29 @@ class ExecuteSSSDAdAuthentication:
|
|||
file_default_pam.close()
|
||||
|
||||
# Execute the commands that require for join Domain
|
||||
(result_code, p_out, p_err) = self.util.execute("realm discover {}".format(domain_name.upper()))
|
||||
if (result_code == 0):
|
||||
self.logger.info("Realm Discover komutu başarılı")
|
||||
else:
|
||||
self.logger.error("Realm Discover komutu başarısız : " + str(p_err))
|
||||
# (result_code, p_out, p_err) = self.util.execute("realm discover {}".format(domain_name.upper()))
|
||||
# if (result_code == 0):
|
||||
# self.logger.info("Realm Discover komutu başarılı")
|
||||
# else:
|
||||
# self.logger.error("Realm Discover komutu başarısız : " + str(p_err))
|
||||
|
||||
self.domain_try_counter2 = 0
|
||||
try:
|
||||
while (True):
|
||||
self.domain_try_counter2 = self.domain_try_counter2 + 1
|
||||
if (self.domain_try_counter2 == 10):
|
||||
break
|
||||
else:
|
||||
(result_code, p_out, p_err) = self.util.execute("realm discover {}".format(domain_name.upper()))
|
||||
if (result_code == 0):
|
||||
self.logger.info("Realm Discover komutu başarılı")
|
||||
break
|
||||
else:
|
||||
self.logger.error("Realm Discover komutu başarısız : ")
|
||||
time.sleep(2)
|
||||
except Exception as e:
|
||||
self.logger.error(e)
|
||||
self.logger.info("AD DİSCOVER Login işlemi esnasında hata oluştu.")
|
||||
|
||||
self.domain_try_counter = 0
|
||||
|
||||
|
@ -157,7 +175,7 @@ class ExecuteSSSDAdAuthentication:
|
|||
self.logger.info("Realm Join komutu başarılı")
|
||||
break
|
||||
else:
|
||||
self.logger.error("Realm Join komutu başarısız : " + str(p_err))
|
||||
self.logger.error("Realm Join komutu başarısız : ")
|
||||
time.sleep(2)
|
||||
|
||||
# Configure sssd template
|
||||
|
|
Loading…
Reference in a new issue