Password set now works on an empty password file
Password set now works on an empty password file Change-Id: Icb26a0b2d88e2bfc4593e83787ca06e9ca51b186
This commit is contained in:
parent
7c0bc714f1
commit
edeb5d6483
|
@ -204,6 +204,9 @@ def change_password(file_path, pname, pvalue=None, public_key=None,
|
|||
"""
|
||||
read_data = sync_read_file(file_path)
|
||||
file_pwds = yaml.safe_load(read_data)
|
||||
# if the password file is empty file_pwds will be None after safe_load
|
||||
if file_pwds is None:
|
||||
file_pwds = {}
|
||||
if clear:
|
||||
# clear
|
||||
if pname in file_pwds:
|
||||
|
|
Loading…
Reference in New Issue