diff options
author | Corentin LABBE <clabbe@baylibre.com> | 2020-11-18 13:43:51 +0000 |
---|---|---|
committer | Corentin LABBE <clabbe@baylibre.com> | 2020-11-23 10:01:35 +0000 |
commit | 13dcdb52eb69f3a022244e840e7d671375133702 (patch) | |
tree | f96d9877928202d723b314ac96b53b15a026cae3 /lavalab-gen.py | |
parent | 90e298003a22ad0a91e35a7a987c57503a7dd31f (diff) |
check if envdir exists before creating it
If envdir already exists, lavalab-gen.py fail
Diffstat (limited to 'lavalab-gen.py')
-rwxr-xr-x | lavalab-gen.py | 3 |
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"]: |