diff options
author | Corentin LABBE <clabbe@baylibre.com> | 2019-05-17 15:36:32 +0200 |
---|---|---|
committer | Corentin LABBE <clabbe@baylibre.com> | 2019-05-17 15:36:32 +0200 |
commit | 395a97a7f0ab362a513e344eb5f1c82104a77804 (patch) | |
tree | 226043d2653af5a654bee88aec4d39f52688e0f1 | |
parent | f1a9bf4c897557f4be42e26082d0f4d778534597 (diff) |
lavalab-gen.py: fix read of bind_dev
Since bind_dev could be set to false, just testing its presence is
wrong.
This patch made lavalab-gen.py check its value.
-rwxr-xr-x | lavalab-gen.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lavalab-gen.py b/lavalab-gen.py index ef4fd38..6332284 100755 --- a/lavalab-gen.py +++ b/lavalab-gen.py @@ -426,7 +426,7 @@ def main(): if "expose_ports" in worker: for eports in worker["expose_ports"]: dockcomp["services"][name]["ports"].append("%s" % eports) - if "bind_dev" in worker: + if "bind_dev" in worker and worker["bind_dev"]: dockcomp["services"][worker_name]["volumes"].append("/dev:/dev") dockcomp["services"][worker_name]["privileged"] = True if "use_tap" in worker and worker["use_tap"]: @@ -454,7 +454,7 @@ def main(): fudev = open("output/%s/udev/99-lavaworker-udev.rules" % host, "a") fudev.write(udev_line) fudev.close() - if not "bind_dev" in slave: + if not "bind_dev" in slave or not slave["bind_dev"]: dockcomp_add_device(dockcomp, worker_name, "/dev/%s:/dev/%s" % (udev_dev["name"], udev_dev["name"])) use_nfs = False if "use_nfs" in worker: @@ -549,7 +549,7 @@ def main(): fp = open("output/%s/udev/99-lavaworker-udev.rules" % host, "a") fp.write(udev_line) fp.close() - if not "bind_dev" in slave: + if not "bind_dev" in slave or not slave["bind_dev"]: dockcomp_add_device(dockcomp, worker_name, "/dev/%s:/dev/%s" % (board_name, board_name)) use_conmux = False use_ser2net = False |