Fixing an issue where if tap-003 were to attempt to change the password of it's starting node an index error would cause a crash. (only if the starting host was the last host in the account_changes config option)
This commit is contained in:
committed by
Marek Wolan
parent
1b0183f689
commit
3690b61be5
@@ -355,7 +355,12 @@ class TAP003(AbstractTAP, discriminator="tap-003"):
|
|||||||
"new_password": self._next_account_change["new_password"],
|
"new_password": self._next_account_change["new_password"],
|
||||||
}
|
}
|
||||||
self.logger.info("Changing local password.")
|
self.logger.info("Changing local password.")
|
||||||
self._next_account_change = account_changes.pop(0)
|
# If statement to catch last host edge case - we don't want cause an IndexError
|
||||||
|
if len(account_changes) == 0:
|
||||||
|
self.logger.info("No further account changes required.")
|
||||||
|
self._next_account_change = None
|
||||||
|
else:
|
||||||
|
self._next_account_change = account_changes.pop(0)
|
||||||
self._change_password_target_host = self.current_host
|
self._change_password_target_host = self.current_host
|
||||||
else:
|
else:
|
||||||
# make sure we are logged in via ssh to remote node
|
# make sure we are logged in via ssh to remote node
|
||||||
@@ -384,6 +389,7 @@ class TAP003(AbstractTAP, discriminator="tap-003"):
|
|||||||
],
|
],
|
||||||
}
|
}
|
||||||
self.logger.info(f"Changing password on remote node {hostname}")
|
self.logger.info(f"Changing password on remote node {hostname}")
|
||||||
|
# If statement to catch last host edge case - we don't want cause an IndexError
|
||||||
if len(account_changes) == 0:
|
if len(account_changes) == 0:
|
||||||
self.logger.info("No further account changes required.")
|
self.logger.info("No further account changes required.")
|
||||||
self._next_account_change = None
|
self._next_account_change = None
|
||||||
|
|||||||
Reference in New Issue
Block a user