From fa7d0cd24893694ff529a16386cfc7a27f833d59 Mon Sep 17 00:00:00 2001 From: Corentin LABBE Date: Tue, 9 Jan 2018 16:46:18 +0100 Subject: Move conmux and slaves directory creation Thoses two directory are necessary even with setup without conmux and slaves. (Due to Dockerfile COPY). This patch move the creation of thoses two directory at start of lavalav-gen.py --- lavalab-gen.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lavalab-gen.py b/lavalab-gen.py index 49203ec..6baa825 100755 --- a/lavalab-gen.py +++ b/lavalab-gen.py @@ -50,6 +50,16 @@ def main(args): dockcomp["services"]["lava-slave"]["devices"] = [] dc_devices = dockcomp["services"]["lava-slave"]["devices"] + # The slaves directory must exists + if not os.path.isdir("lava-master/slaves/"): + os.mkdir("lava-master/slaves/") + fp = open("lava-master/slaves/.empty", "w") + fp.close() + if not os.path.isdir("lava-slave/conmux/"): + os.mkdir("lava-slave/conmux/") + fp = open("lava-slave/conmux/.empty", "w") + fp.close() + for lab_name in labs: lab = labs[lab_name] for board_name in lab["boardlist"]: @@ -77,8 +87,6 @@ def main(args): fserial = b["fastboot_serial_number"] device_line += "{%% set fastboot_serial_number = '%s' %%}" % fserial - if not os.path.isdir("lava-slave/conmux/"): - os.mkdir("lava-slave/conmux/") # board specific hacks if devicetype == "qemu": device_line += "{% set no_kvm = True %}\n" @@ -98,8 +106,6 @@ def main(args): fp.write(udev_line) fp.close() if lab.has_key("dispatcher_ip"): - if not os.path.isdir("lava-master/slaves/"): - os.mkdir("lava-master/slaves/") fp = open("lava-master/slaves/%s.yaml" % lab_name, "w") fp.write("dispatcher_ip: %s" % lab["dispatcher_ip"]) fp.close() -- cgit 1.2.3-korg