vm.verify_alive()
platform_str = " on %s" % vm.name
for i in range(timeout):
- log.debug("Checking whether %s is running%s (%i\%i)",
+ log.debug("Checking whether %s is running%s (%i/%i)",
process, platform_str, i, timeout)
result = run_cmd(cmd="pgrep -l -x %s" % process,
ignore_errors=True, vm=vm)
# ONLINE signal to arnied is transmitted
# asynchronously via arnieclient_muxer.
+ def status_func_online():
+ go_online(provider_id, False, vm)
+
+ def status_func_offline():
+ go_offline(False, vm)
+
if status == 'online':
expected_output = 'DEFAULT: 2'
- set_status_func = lambda: go_online(provider_id, False, vm)
+ set_status_func = status_func_online
elif status == 'offline':
expected_output = 'DEFAULT: 0'
- set_status_func = lambda: go_offline(False, vm)
+ set_status_func = status_func_offline
else:
raise ValueError('expect status "online" or "offline", not "{0}"!'
.format(status))
contents = "%i\n%s\n" % (exec_time, optional_args)
tmp_file = tempfile.NamedTemporaryFile(mode="w+",
- prefix=program.upper() + "_",
- delete=False)
+ prefix=program.upper() + "_",
+ delete=False)
log.debug("Created temporary file %s", tmp_file.name)
tmp_file.write(contents)
tmp_file.close()