create new password (principal) if does not exist
parent
756f6cbe66
commit
9ad4122061
|
@ -88,13 +88,18 @@ def main():
|
||||||
if args.show_password:
|
if args.show_password:
|
||||||
print(f'password: "{password}"')
|
print(f'password: "{password}"')
|
||||||
|
|
||||||
|
action = 'reset' if p is not None else 'create'
|
||||||
i = input(
|
i = input(
|
||||||
f"Type yes to reset {user}'s password and send email to {address}\n"
|
f"Type yes to {action} {user}'s password and send email to {address!r}\n"
|
||||||
).strip()
|
).strip()
|
||||||
if i != "yes":
|
if i != "yes":
|
||||||
print("Aborted")
|
print("Aborted")
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if p is None:
|
||||||
|
k.add_principal(user, password)
|
||||||
|
print("password created")
|
||||||
|
else:
|
||||||
p.change_password(password)
|
p.change_password(password)
|
||||||
print("password changed")
|
print("password changed")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue