# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
topology = yaml.safe_load(topo_file.read())[u"nodes"]
# Even if TG is not guaranteed to be a Linux host,
topology = yaml.safe_load(topo_file.read())[u"nodes"]
# Even if TG is not guaranteed to be a Linux host,
# store additional data (time, client_ID, ..) within reservation directory.
if args.cancel:
ret, _, err = exec_cmd(node, f"rm -r {RESERVATION_DIR}")
# store additional data (time, client_ID, ..) within reservation directory.
if args.cancel:
ret, _, err = exec_cmd(node, f"rm -r {RESERVATION_DIR}")
# Before critical section, output can be outdated already.
print(u"Diagnostic commands:")
# -d and * are to suppress "total <size>", see https://askubuntu.com/a/61190
# Before critical section, output can be outdated already.
print(u"Diagnostic commands:")
# -d and * are to suppress "total <size>", see https://askubuntu.com/a/61190
# Entering critical section.
ret, _, _ = exec_cmd(node, f"mkdir '{RESERVATION_DIR}'")
# Critical section is over.
# Entering critical section.
ret, _, _ = exec_cmd(node, f"mkdir '{RESERVATION_DIR}'")
# Critical section is over.
_, stdo, _ = exec_cmd(node, f"ls '{RESERVATION_DIR}'/*")
print(f"Testbed already reserved by:\n{stdo}")
return 2
_, stdo, _ = exec_cmd(node, f"ls '{RESERVATION_DIR}'/*")
print(f"Testbed already reserved by:\n{stdo}")
return 2
print(u"Reservation success, writing additional info to reservation dir.")
ret, _, err = exec_cmd(
node, f"touch '{RESERVATION_DIR}/{args.runtag}'")
print(u"Reservation success, writing additional info to reservation dir.")
ret, _, err = exec_cmd(
node, f"touch '{RESERVATION_DIR}/{args.runtag}'")