mirror of
https://github.com/xcat2/confluent.git
synced 2026-04-13 04:11:31 +00:00
Set password before setting username
The BMC is at much higher risk for rejecting the password (e.g. the password does not pass complexity requirements). If the username changes, but the password is still default, it is very confusing. Give the password change the chance to break the configuration process first.
This commit is contained in:
@@ -124,16 +124,18 @@ class NodeHandler(generic.NodeHandler):
|
||||
if currusers[uid]['name'] == newuser:
|
||||
# Use existing account that has been created
|
||||
newuserslot = uid
|
||||
if newpass != passwd: # don't mess with existing if no change
|
||||
ic.set_user_password(newuserslot, password=newpass)
|
||||
break
|
||||
else:
|
||||
newuserslot = lockedusers + 1
|
||||
if newuserslot < 2:
|
||||
newuserslot = 2
|
||||
if newpass != passwd: # don't mess with existing if no change
|
||||
ic.set_user_password(newuserslot, password=newpass)
|
||||
ic.set_user_name(newuserslot, newuser)
|
||||
ic.set_user_access(newuserslot, lanchan,
|
||||
privilege_level='administrator')
|
||||
if newpass != passwd: # don't mess with existing if no change
|
||||
ic.set_user_password(newuserslot, password=newpass)
|
||||
# Now to zap others
|
||||
for uid in currusers:
|
||||
if uid != newuserslot:
|
||||
|
||||
Reference in New Issue
Block a user