mirror of
https://github.com/altlinux/gpupdate.git
synced 2025-03-21 18:50:38 +03:00
Select dc in one function call
This commit is contained in:
parent
e31aac8bbc
commit
ad6712a6de
@ -46,11 +46,7 @@ class gpoa_controller:
|
||||
|
||||
# Determine the default Samba DC for replication and try
|
||||
# to overwrite it with user setting.
|
||||
dc = None
|
||||
try:
|
||||
dc = util.select_dc(self.__lp, self.__creds, self.__args.dc)
|
||||
except:
|
||||
pass
|
||||
dc = util.select_dc(self.__lp, self.__creds, self.__args.dc)
|
||||
|
||||
username = self.__args.user
|
||||
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
|
||||
|
||||
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:
|
||||
logging.debug('Samba DC setting is {} and is overwritten by user setting {}'.format(samba_dc, dc))
|
||||
return dc
|
||||
|
||||
return samba_dc
|
||||
if samba_dc != dc and dc != None:
|
||||
logging.debug('Samba DC setting is {} and is overwritten by user setting {}'.format(samba_dc, dc))
|
||||
return dc
|
||||
return samba_dc
|
||||
except:
|
||||
logging.error('Unable to determine DC hostname')
|
||||
return None
|
||||
|
||||
def wbinfo_getsid(domain, user):
|
||||
'''
|
||||
|
Loading…
x
Reference in New Issue
Block a user