summaryrefslogtreecommitdiff
path: root/ybd/sandbox.py
diff options
context:
space:
mode:
authorBen Brown <ben.brown@codethink.co.uk>2017-06-20 16:02:03 +0100
committerBen Brown <ben.brown@codethink.co.uk>2017-06-20 16:12:26 +0100
commitcca75b0824b312ef50490c4cebfdee6184039b59 (patch)
treeeb4b4ca2f13008079205465928d6b062d25159fb /ybd/sandbox.py
parentd0965e1da7b870632213147bc978575aaa1fbf62 (diff)
downloadybd-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.
Diffstat (limited to 'ybd/sandbox.py')
-rw-r--r--ybd/sandbox.py7
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')):