Required, when running get_account_attributes() against a remote samdb.
avoid:
ERROR(<class 'AttributeError'>): uncaught exception - 'NoneType' object has no attribute 'get'
File "bin/python/samba/netcmd/__init__.py", line 186, in _run
return self.run(*args, **kwargs)
File "bin/python/samba/netcmd/user.py", line 2769, in run
obj = self.get_account_attributes(samdb, username,
File "bin/python/samba/netcmd/user.py", line 1250, in get_account_attributes
realm = self.lp.get("realm")
Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
if "userPrincipalName" in obj:
account_upn = str(obj["userPrincipalName"][0])
else:
- realm = self.lp.get("realm")
+ realm = samdb.domain_dns_name()
account_upn = "%s@%s" % (account_name, realm.lower())
if add_userPrincipalName:
del obj["userPrincipalName"]
i = int(x)
except ValueError:
continue
- domain = self.lp.get("workgroup")
+ domain = samdb.domain_netbios_name()
dns_domain = samdb.domain_dns_name()
v = get_wDigest(i, primary_wdigest, account_name, account_upn, domain, dns_domain)
if v is None: