diff options
| author | Sam Yaple <sam@yaple.net> | 2015-07-14 07:00:55 +0000 |
|---|---|---|
| committer | Sam Yaple <sam@yaple.net> | 2015-07-14 12:20:04 +0000 |
| commit | 2a6437efdd208e92c71157e2613f7a140c9a14a5 (patch) | |
| tree | ff4ecf36ae25bcad9fbcd84f2ca635d93d2ce923 | |
| parent | 69338a94ba0969241a8b669eba824956912d71c4 (diff) | |
| download | kolla-2a6437efdd208e92c71157e2613f7a140c9a14a5.tar.gz kolla-2a6437efdd208e92c71157e2613f7a140c9a14a5.zip | |
Improve build.py
Fixed docker client to use ENV if exists to support boot2docker.
Fixed booleans not working as thought with argParser.
Change-Id: I232ed78443199ce20f4b38e12c861c0f97d55c99
Partially-Implements: blueprint build-script
| -rwxr-xr-x | tools/build.py | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/tools/build.py b/tools/build.py index cb3b6ce57..11f23f603 100755 --- a/tools/build.py +++ b/tools/build.py @@ -37,11 +37,11 @@ import docker class WorkerThread(Thread): - def __init__(self, queue, cache, rm): + def __init__(self, queue, nocache, keep): self.queue = queue - self.nocache = not cache - self.forcerm = rm - self.dc = docker.Client() + self.nocache = nocache + self.forcerm = not keep + self.dc = docker.Client(**docker.utils.kwargs_from_env()) Thread.__init__(self) def run(self): @@ -85,7 +85,7 @@ class WorkerThread(Thread): raise Exception(stream['errorDetail']['message']) image['status'] = "built" - print(image['logs'], '\nProcessed:', image['name']) + print(image['logs'], 'Processed:', image['name']) def argParser(): @@ -106,14 +106,14 @@ def argParser(): help='The method of the Openstack install', type=str, default='binary') - parser.add_argument('-c', '--cache', - help='Use Docker cache when building', - type=bool, - default=True) - parser.add_argument('-r', '--rm', - help='Remove intermediate containers while building', - type=bool, - default=True) + parser.add_argument('--no-cache', + help='Do not use the Docker cache when building', + action='store_true', + default=False) + parser.add_argument('--keep', + help='Keep failed intermediate containers building', + action='store_true', + default=False) parser.add_argument('-T', '--threads', help='The number of threads to use while building', type=int, @@ -258,7 +258,7 @@ def main(): # Returns a list of Queues for us to loop through for pool in kolla.buildQueues(): for x in xrange(args['threads']): - WorkerThread(pool, args['cache'], args['rm']).start() + WorkerThread(pool, args['no_cache'], args['keep']).start() # block until queue is empty pool.join() |
