summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCorentin LABBE <clabbe@baylibre.com>2018-01-09 16:46:18 +0100
committerCorentin LABBE <clabbe@baylibre.com>2018-02-02 14:24:19 +0100
commitfa7d0cd24893694ff529a16386cfc7a27f833d59 (patch)
tree70198425c50f845eb653d1ed55d94072aa260c62
parentd7b3ab2ca280c8ee1dafb4773bf979b805debf0a (diff)
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
-rwxr-xr-xlavalab-gen.py14
1 files 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()