summaryrefslogtreecommitdiffstats
path: root/lavalab-gen.py
diff options
context:
space:
mode:
authorCorentin LABBE <clabbe@baylibre.com>2018-10-25 15:25:50 +0200
committerCorentin LABBE <clabbe@baylibre.com>2018-11-02 16:47:59 +0100
commit11552973aa27342aa132e289debd0f01d835b5f5 (patch)
tree92848b04fd2ab13b13579afd25d4ef9be43b0dd9 /lavalab-gen.py
parent5957ee693f8cc7b07613da6c2c7da576d7039e2f (diff)
lavalab-gen.py: permit to set env settings on slave via the master node
Since some setup use distinct boards.yaml for master and slave, a way to set env settings for a slave via the master node is needed.
Diffstat (limited to 'lavalab-gen.py')
-rwxr-xr-xlavalab-gen.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/lavalab-gen.py b/lavalab-gen.py
index 202ec99..5191f07 100755
--- a/lavalab-gen.py
+++ b/lavalab-gen.py
@@ -93,7 +93,7 @@ def main():
else:
masters = workers["masters"]
for master in masters:
- keywords_master = [ "name", "type", "host", "users", "groups", "tokens", "webadmin_https", "persistent_db", "zmq_auth", "zmq_auth_key", "zmq_auth_key_secret", "http_fqdn", "slave_keys" ]
+ keywords_master = [ "name", "type", "host", "users", "groups", "tokens", "webadmin_https", "persistent_db", "zmq_auth", "zmq_auth_key", "zmq_auth_key_secret", "http_fqdn", "slave_keys", "slaveenv" ]
for keyword in master:
if not keyword in keywords_master:
print("WARNING: unknown keyword %s" % keyword)
@@ -243,6 +243,16 @@ def main():
ftok.write("TOKEN=" + vtoken + "\n")
ftok.write("DESCRIPTION=\"%s\"" % description)
ftok.close()
+ if "slaveenv" in worker:
+ for slaveenv in worker["slaveenv"]:
+ slavename = slaveenv["name"]
+ envdir = "%s/env/%s" % (workerdir, slavename)
+ os.mkdir(envdir)
+ fenv = open("%s/env.yaml" % envdir, 'w')
+ fenv.write("overrides:")
+ for line in slaveenv["env"]:
+ fenv.write(" %s\n" % line)
+ fenv.close()
default_slave = "lab-slave-0"
if "slaves" not in workers: