Add and use cmd.py to retry command that may fail
HA takes some time to converge and so we may have to retry commands in the test that expect a certain HA mode. This is a better alternative than just including a blanket sleep statement.
Closes #264 (closed)