mirror of
https://github.com/dkmstr/openuds.git
synced 2025-01-03 01:17:56 +03:00
Fixed Windows domain
This commit is contained in:
parent
41f128c2ad
commit
83efb81966
@ -177,9 +177,9 @@ class CommonService(object):
|
||||
except REST.UserServiceNotFoundError:
|
||||
logger.error('The host has lost the sync state with broker! (host uuid changed?)')
|
||||
return False
|
||||
except Exception as e:
|
||||
except Exception as err:
|
||||
if counter % 60 == 0:
|
||||
logger.warn('Too many retries in progress, though still trying (last error: {})'.format(exceptionToMessage(e)))
|
||||
logger.warn('Too many retries in progress, though still trying (last error: {})'.format(exceptionToMessage(err)))
|
||||
counter += 1
|
||||
# Any other error is expectable and recoverable, so let's wait
|
||||
# a bit and retry again
|
||||
|
@ -138,8 +138,8 @@ class UDSActorSvc(win32serviceutil.ServiceFramework, CommonService):
|
||||
currName = operations.getComputerName()
|
||||
if currName.lower() == name.lower():
|
||||
currDomain = operations.getDomainName()
|
||||
logger.debug('Name: "{}" vs "{}", Domain: "{}" vs "{}"'.format(currName.lower(), name.lower(), currDomain.lower(), domain.lower()))
|
||||
if currDomain is not None:
|
||||
# logger.debug('Name: "{}" vs "{}", Domain: "{}" vs "{}"'.format(currName.lower(), name.lower(), currDomain.lower(), domain.lower()))
|
||||
logger.info(
|
||||
'Machine {} is part of domain {}'.format(name, domain))
|
||||
self.setReady()
|
||||
@ -155,7 +155,7 @@ class UDSActorSvc(win32serviceutil.ServiceFramework, CommonService):
|
||||
def joinDomain(self, name, domain, ou, account, password):
|
||||
ver = operations.getWindowsVersion()
|
||||
ver = ver[0] * 10 + ver[1]
|
||||
logger.info('Starting joining domain {} with name {} (detected operating version: {})'.format(
|
||||
logger.debug('Starting joining domain {} with name {} (detected operating version: {})'.format(
|
||||
domain, name, ver))
|
||||
# Accepts one step joinDomain, also remember XP is no more supported by
|
||||
# microsoft, but this also must works with it because will do a "multi
|
||||
|
@ -172,8 +172,8 @@ def joinDomain(domain, ou, account, password, executeInOneStep=False):
|
||||
error = getErrorMessage(res)
|
||||
if res == 1355:
|
||||
error = "DC Is not reachable"
|
||||
print res, error
|
||||
raise Exception('Error joining domain {}, with credentials {}/*****{}: {}, {}'.format(domain.value, account.value, ', under OU {}'.format(ou.value) if ou.value is not None else '', res, error))
|
||||
logger.error('Error joining domain: {}, {}'.format(error, res))
|
||||
raise Exception('Error joining domain {}, with credentials {}/*****{}: {}, {}'.format(domain, account, ', under OU {}'.format(ou) if ou is not None else '', res, error))
|
||||
|
||||
|
||||
def changeUserPassword(user, oldPassword, newPassword):
|
||||
|
@ -65,7 +65,7 @@ class WinDomainOsManager(WindowsOsManager):
|
||||
self._ou = self._ou.replace(' ', '')
|
||||
if self._domain != '' and self._ou != '':
|
||||
lpath = 'dc=' + ',dc='.join(self._domain.split('.'))
|
||||
if self._ou.find(lpath) == -1:
|
||||
if self._ou.lower().find(lpath) == -1:
|
||||
self._ou += ',' + lpath
|
||||
|
||||
def __getLdapError(self, e):
|
||||
|
Loading…
Reference in New Issue
Block a user