mirror of
https://github.com/altlinux/gpupdate.git
synced 2025-03-27 22:50:32 +03:00
util.windows: Re-raise exceptions when working with domain
This is needed to prevent wipe of settings done by backend in case of successful GPO retrieval by Samba. This commit re-raises exceptions which must be caught by backend runner in `gpoa`.
This commit is contained in:
parent
9d40910890
commit
19cb5c072a
@ -64,8 +64,9 @@ class smbcreds (smbopts):
|
||||
self.selected_dc = dc_fqdn
|
||||
else:
|
||||
self.selected_dc = samba_dc
|
||||
except:
|
||||
except Exception as exc:
|
||||
logging.error(slogm('Unable to determine DC hostname'))
|
||||
raise exc
|
||||
|
||||
return self.selected_dc
|
||||
|
||||
@ -80,8 +81,9 @@ class smbcreds (smbopts):
|
||||
res = netcmd_get_domain_infos_via_cldap(self.lp, None, self.selected_dc)
|
||||
dns_domainname = res.dns_domain
|
||||
logging.info(slogm('Found domain via CLDAP: {}'.format(dns_domainname)))
|
||||
except:
|
||||
except Exception as exc:
|
||||
logging.error(slogm('Unable to retrieve domain name via CLDAP query'))
|
||||
raise exc
|
||||
|
||||
return dns_domainname
|
||||
|
||||
@ -118,6 +120,7 @@ class smbcreds (smbopts):
|
||||
logging.error(
|
||||
slogm('Unable to refresh GPO list for {} from {}'.format(
|
||||
username, self.selected_dc)))
|
||||
raise exc
|
||||
return gpos
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user