summaryrefslogtreecommitdiff
path: root/kolla/cmd
diff options
context:
space:
mode:
authorSamYaple <sam@yaple.net>2016-02-18 03:01:49 +0000
committerMartin André <m.andre@redhat.com>2016-03-09 18:36:13 +0900
commit279594ab6456694de883f0a6873de65d41e0ca8f (patch)
tree5350f33efe0668f9e1bea7512d482bf0b025b5b2 /kolla/cmd
parent13a60622601a3fc8535c0ee8c10a1da2d0ea928b (diff)
downloadkolla-279594ab6456694de883f0a6873de65d41e0ca8f.tar.gz
kolla-279594ab6456694de883f0a6873de65d41e0ca8f.zip
Add local directory or file for source build
This change allows using a local directory or tarball to build from sources by specifying the 'local' type in your kolla-build.conf: [keystone-base] type=local location=/home/martin/src/keystone [neutron-server-plugin-networking-cisco] type=local location=/tmp/networking-cisco.tar.gz Closes-Bug: #1509625 Co-Authored-By: Martin André <m.andre@redhat.com> Change-Id: I3f6f68b0f44efdac653d186d2625591ad7cb3b2a
Diffstat (limited to 'kolla/cmd')
-rwxr-xr-xkolla/cmd/build.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/kolla/cmd/build.py b/kolla/cmd/build.py
index d21109647..1bb8d8076 100755
--- a/kolla/cmd/build.py
+++ b/kolla/cmd/build.py
@@ -208,6 +208,16 @@ class WorkerThread(threading.Thread):
with tarfile.open(dest_archive, 'w') as tar:
tar.add(clone_dir, arcname=os.path.basename(clone_dir))
+ elif source.get('type') == 'local':
+ LOG.debug("%s:Getting local archive from %s", image['name'],
+ source['source'])
+ if os.path.isdir(source['source']):
+ with tarfile.open(dest_archive, 'w') as tar:
+ tar.add(source['source'],
+ arcname=os.path.basename(source['source']))
+ else:
+ shutil.copyfile(source['source'], dest_archive)
+
else:
LOG.error("%s:Wrong source type '%s'", image['name'],
source.get('type'))