summaryrefslogtreecommitdiffstats
path: root/lavalab-gen.py
diff options
context:
space:
mode:
authorCorentin LABBE <clabbe@baylibre.com>2019-08-21 10:53:16 +0200
committerCorentin LABBE <clabbe@baylibre.com>2020-01-16 11:43:22 +0100
commit8cf19027a638428f3267f2da5fb594bff7ed2841 (patch)
tree4f54aa88e39dc0f67fd5a7ddbc7ed33ca53fd55b /lavalab-gen.py
parent694f774c113da4e2b15fead6b3e19ac95a9528bd (diff)
Add custom volumes
For some case, we need to add custom volumes (like for /var/lib/lxc/cache)
Diffstat (limited to 'lavalab-gen.py')
-rwxr-xr-xlavalab-gen.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/lavalab-gen.py b/lavalab-gen.py
index a766e5f..218f5ec 100755
--- a/lavalab-gen.py
+++ b/lavalab-gen.py
@@ -364,7 +364,7 @@ def main():
else:
slaves = workers["slaves"]
for slave in slaves:
- keywords_slaves = [ "name", "host", "dispatcher_ip", "remote_user", "remote_master", "remote_address", "remote_rpc_port", "remote_proto", "extra_actions", "zmq_auth_key", "zmq_auth_key_secret", "default_slave", "export_ser2net", "expose_ser2net", "remote_user_token", "zmq_auth_master_key", "expose_ports", "env", "bind_dev", "loglevel", "use_nfs", "arch", "devices", "lava-coordinator", "use_tap", "host_healthcheck", "use_tftp", "use_nbd", "use_overlay_server", "tags", "use_docker" ]
+ keywords_slaves = [ "name", "host", "dispatcher_ip", "remote_user", "remote_master", "remote_address", "remote_rpc_port", "remote_proto", "extra_actions", "zmq_auth_key", "zmq_auth_key_secret", "default_slave", "export_ser2net", "expose_ser2net", "remote_user_token", "zmq_auth_master_key", "expose_ports", "env", "bind_dev", "loglevel", "use_nfs", "arch", "devices", "lava-coordinator", "use_tap", "host_healthcheck", "use_tftp", "use_nbd", "use_overlay_server", "tags", "use_docker", "custom_volumes" ]
for keyword in slave:
if not keyword in keywords_slaves:
print("WARNING: unknown keyword %s" % keyword)
@@ -479,6 +479,13 @@ def main():
for line in slave["env"]:
fenv.write(" %s\n" % line)
fenv.close()
+ if "custom_volumes" in slave:
+ for cvolume in slave["custom_volumes"]:
+ dockcomp["services"][worker_name]["volumes"].append(cvolume)
+ volume_name = cvolume.split(':')[0]
+ if "volumes" not in dockcomp:
+ dockcomp["volumes"] = {}
+ dockcomp["volumes"][volume_name] = {}
if not "remote_proto" in worker:
remote_proto = "http"
else: