diff options
author | Ben Brown <ben.brown@codethink.co.uk> | 2017-06-20 16:02:03 +0100 |
---|---|---|
committer | Ben Brown <ben.brown@codethink.co.uk> | 2017-06-20 16:12:26 +0100 |
commit | cca75b0824b312ef50490c4cebfdee6184039b59 (patch) | |
tree | eb4b4ca2f13008079205465928d6b062d25159fb | |
parent | d0965e1da7b870632213147bc978575aaa1fbf62 (diff) | |
download | ybd-cca75b0824b312ef50490c4cebfdee6184039b59.tar.gz |
Fix rpm generation from chunks
Currently fails to make use of the staging area when passing ybd the
path to a chunk with rpm_generation set to true. sandbox.setup() creates
the directory we try to create during rpm packaging, handle the case
where the path already exists.
-rw-r--r-- | ybd/sandbox.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ybd/sandbox.py b/ybd/sandbox.py index fe8073c..fe72b07 100644 --- a/ybd/sandbox.py +++ b/ybd/sandbox.py @@ -18,6 +18,7 @@ import sandboxlib import contextlib import os +import errno import pipes import shutil import stat @@ -78,7 +79,11 @@ def install(dn, component, subdir=None): destdir = dn['sandbox'] else: destdir = os.path.join(dn['sandbox'], subdir) - os.mkdir(destdir) + try: + os.mkdir(destdir) + except OSError as e: + if e.errno == errno.EEXIST: + pass # populate destdir with the artifact files from component if os.path.exists(os.path.join(destdir, 'baserock', component['name'] + '.meta')): |