summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCorentin LABBE <clabbe@baylibre.com>2020-11-18 13:43:51 +0000
committerCorentin LABBE <clabbe@baylibre.com>2020-11-23 10:01:35 +0000
commit13dcdb52eb69f3a022244e840e7d671375133702 (patch)
treef96d9877928202d723b314ac96b53b15a026cae3
parent90e298003a22ad0a91e35a7a987c57503a7dd31f (diff)
check if envdir exists before creating it
If envdir already exists, lavalab-gen.py fail
-rwxr-xr-xlavalab-gen.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/lavalab-gen.py b/lavalab-gen.py
index ff0e717..d088bbb 100755
--- a/lavalab-gen.py
+++ b/lavalab-gen.py
@@ -369,7 +369,8 @@ def main():
for slaveenv in worker["slaveenv"]:
slavename = slaveenv["name"]
envdir = "%s/env/%s" % (workerdir, slavename)
- os.mkdir(envdir)
+ if not os.path.isdir(envdir):
+ os.mkdir(envdir)
fenv = open("%s/env.yaml" % envdir, 'w')
fenv.write("overrides:\n")
for line in slaveenv["env"]: