2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-22 17:43:14 +00:00

Restore password policy set to nodediscover

The shift away from IPMI had omitted the password policy set.
Amend the function and restore it to the sequence of events.
This commit is contained in:
Jarrod Johnson 2019-07-08 16:25:07 -04:00
parent fbc4fc6846
commit 0ad0c626c2

View File

@ -107,7 +107,7 @@ class NodeHandler(immhandler.NodeHandler):
if wc:
return wc
def set_password_policy(self, ic):
def set_password_policy(self):
ruleset = {'USER_GlobalMinPassChgInt': '0'}
for rule in self.ruleset.split(','):
if '=' not in rule:
@ -127,10 +127,8 @@ class NodeHandler(immhandler.NodeHandler):
ruleset['USER_GlobalPassComplexRequired'] = value
if name.lower() == 'reuse':
ruleset['USER_GlobalMinPassReuseCycle'] = value
ic.register_key_handler(self.validate_cert)
ic.oem_init()
try:
ic._oem.immhandler.wc.grab_json_response('/api/dataset', ruleset)
self.wc.grab_json_response('/api/dataset', ruleset)
except Exception as e:
print(repr(e))
pass
@ -223,6 +221,7 @@ class NodeHandler(immhandler.NodeHandler):
self.nodename, ['secret.hardwaremanagementuser',
'secret.hardwaremanagementpassword'], decrypt=True)
user, passwd, isdefault = self.get_node_credentials(nodename, creds, 'USERID', 'PASSW0RD')
self.set_password_policy()
if self._atdefaultcreds:
if not isdefault:
self._setup_xcc_account(user, passwd, wc)