mirror of
https://github.com/altlinux/gpupdate.git
synced 2025-08-25 09:49:53 +03:00
Select dc in one function call
This commit is contained in:
@ -46,11 +46,7 @@ class gpoa_controller:
|
|||||||
|
|
||||||
# Determine the default Samba DC for replication and try
|
# Determine the default Samba DC for replication and try
|
||||||
# to overwrite it with user setting.
|
# to overwrite it with user setting.
|
||||||
dc = None
|
dc = util.select_dc(self.__lp, self.__creds, self.__args.dc)
|
||||||
try:
|
|
||||||
dc = util.select_dc(self.__lp, self.__creds, self.__args.dc)
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
username = self.__args.user
|
username = self.__args.user
|
||||||
domain = util.get_domain_name(self.__lp, self.__creds, dc)
|
domain = util.get_domain_name(self.__lp, self.__creds, dc)
|
||||||
|
@ -32,13 +32,16 @@ def get_gpo_list(dc_hostname, creds, lp, user):
|
|||||||
return gpos
|
return gpos
|
||||||
|
|
||||||
def select_dc(lp, creds, dc):
|
def select_dc(lp, creds, dc):
|
||||||
samba_dc = get_dc_hostname(creds, lp)
|
try:
|
||||||
|
samba_dc = get_dc_hostname(creds, lp)
|
||||||
|
|
||||||
if samba_dc != dc and dc != None:
|
if samba_dc != dc and dc != None:
|
||||||
logging.debug('Samba DC setting is {} and is overwritten by user setting {}'.format(samba_dc, dc))
|
logging.debug('Samba DC setting is {} and is overwritten by user setting {}'.format(samba_dc, dc))
|
||||||
return dc
|
return dc
|
||||||
|
return samba_dc
|
||||||
return samba_dc
|
except:
|
||||||
|
logging.error('Unable to determine DC hostname')
|
||||||
|
return None
|
||||||
|
|
||||||
def wbinfo_getsid(domain, user):
|
def wbinfo_getsid(domain, user):
|
||||||
'''
|
'''
|
||||||
|
Reference in New Issue
Block a user