1
0
mirror of https://github.com/altlinux/gpupdate.git synced 2025-03-28 14:50:14 +03:00

Return nodomain backend in case there is no domain yet (for bootsrap)

This commit is contained in:
Игорь Чудов 2020-01-21 20:11:30 +04:00
parent 5e89b28069
commit b0502a9681
Signed by untrusted user: nir
GPG Key ID: 0F3883600CAE7AAC

View File

@ -31,10 +31,16 @@ def backend_factory(dc, username):
domain = sc.get_domain()
back = None
try:
back = samba_backend(sc, username, domain)
except Exception as exc:
logging.error('Unable to initialize Samba backend: {}'.format(exc))
if dc:
try:
back = samba_backend(sc, username, domain)
except Exception as exc:
logging.error('Unable to initialize Samba backend: {}'.format(exc))
else:
try:
back = nodomain_backend()
except Exception as exc:
logging.error('Unable to initialize no-domain backend: {}'.format(exc))
return back