def _reboot_all_se(session): se_ips = _get_se_ips(session) for se_ip in se_ips: se = Linux(se_ip, session.username, session.password) se.execute_command("sudo reboot") se.wait_node_up(se_ip) se.close() _wait_for_se_oper_status(session, oper_status="OPER_DOWN", interval=2) _wait_for_se_oper_status(session, oper_status="OPER_UP", interval=2)
def _verify_hsmpkg_uploaded_on_vm(vm_ip, timeout=60, interval=5, user='******', password='******'): vm = Linux(vm_ip, user, password) while timeout > 0: hsmpkg_verify_resp = vm.execute_command("ls /var/lib/avi/hsmpackages/") if hsmpkg_verify_resp: for line in hsmpkg_verify_resp: if "safenet.tar" == line.strip(): LOG.debug( "/var/lib/avi/hsmpackages/safenet.tar verified successfully on VM %s" % vm_ip) return time.sleep(interval) timeout -= interval else: LOG.error("/var/lib/avi/hsmpackages/safenet.tar not found on VM %s" % vm_ip) raise Exception( "/var/lib/avi/hsmpackages/safenet.tar not found on VM %s" % vm_ip) vm.close()