1
0
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:
Игорь Чудов 2020-05-15 21:42:04 +04:00
parent 9d40910890
commit 19cb5c072a
Signed by untrusted user: nir
GPG Key ID: 0F3883600CAE7AAC

View File

@ -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