mirror of
https://github.com/samba-team/samba.git
synced 2025-03-27 22:50:26 +03:00
wintest Set WIN_LCREALM and WIN_BASEDN automatically
Also this uppper cases WIN_REALM, to avoid this being sensitive based on the configuration file. Andrew Bartlett
This commit is contained in:
parent
7ecf6b2451
commit
86c3c42745
@ -26,13 +26,19 @@ class wintest():
|
||||
|
||||
def setwinvars(self, vm, prefix='WIN'):
|
||||
'''setup WIN_XX vars based on a vm name'''
|
||||
for v in ['VM', 'HOSTNAME', 'USER', 'PASS', 'SNAPSHOT', 'BASEDN', 'REALM', 'DOMAIN', 'IP']:
|
||||
for v in ['VM', 'HOSTNAME', 'USER', 'PASS', 'SNAPSHOT', 'REALM', 'DOMAIN', 'IP']:
|
||||
vname = '%s_%s' % (vm, v)
|
||||
if vname in self.vars:
|
||||
self.setvar("%s_%s" % (prefix,v), self.substitute("${%s}" % vname))
|
||||
else:
|
||||
self.vars.pop("%s_%s" % (prefix,v), None)
|
||||
|
||||
if self.getvar("WIN_REALM"):
|
||||
self.setvar("WIN_REALM", self.getvar("WIN_REALM").upper())
|
||||
self.setvar("WIN_LCREALM", self.getvar("WIN_REALM").lower())
|
||||
dnsdomain = self.getvar("WIN_REALM")
|
||||
self.setvar("WIN_BASEDN", "DC=" + dnsdomain.replace(".", ",DC="))
|
||||
|
||||
def info(self, msg):
|
||||
'''print some information'''
|
||||
if not self.list_mode:
|
||||
|
Loading…
x
Reference in New Issue
Block a user