diff options
| author | Jenkins <jenkins@review.openstack.org> | 2016-01-26 11:50:04 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2016-01-26 11:50:04 +0000 |
| commit | 87355c231a3bdf17fc1e9b1412f44f85dd549632 (patch) | |
| tree | 2ed410076b9a182fa0f92dedea080ba99be46791 /kolla/cmd | |
| parent | 75343870e395e257c8d8267ccd9c74e70c7fceb5 (diff) | |
| parent | b82111d589cf3f82cbe115d002b29eee959a428f (diff) | |
| download | kolla-87355c231a3bdf17fc1e9b1412f44f85dd549632.tar.gz kolla-87355c231a3bdf17fc1e9b1412f44f85dd549632.zip | |
Merge "Pick up proxy buildargs from environment"
Diffstat (limited to 'kolla/cmd')
| -rwxr-xr-x | kolla/cmd/build.py | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/kolla/cmd/build.py b/kolla/cmd/build.py index 5a7913534..1e51dde75 100755 --- a/kolla/cmd/build.py +++ b/kolla/cmd/build.py @@ -203,6 +203,23 @@ class WorkerThread(threading.Thread): return dest_archive + def update_buildargs(self): + buildargs = dict() + if self.conf.build_args: + buildargs = dict(self.conf.build_args) + + proxy_vars = ('HTTP_PROXY', 'http_proxy', 'HTTPS_PROXY', + 'https_proxy', 'FTP_PROXY', 'ftp_proxy', + 'NO_PROXY', 'no_proxy') + + for proxy_var in proxy_vars: + if proxy_var in os.environ and proxy_var not in buildargs: + buildargs[proxy_var] = os.environ.get(proxy_var) + + if not buildargs: + return None + return buildargs + def builder(self, image): LOG.debug('%s:Processing', image['name']) if image['status'] == 'unmatched': @@ -255,13 +272,14 @@ class WorkerThread(threading.Thread): pull = True if image['parent'] is None else False image['logs'] = str() + buildargs = self.update_buildargs() for response in self.dc.build(path=image['path'], tag=image['fullname'], nocache=self.nocache, rm=True, pull=pull, forcerm=self.forcerm, - buildargs=self.conf.build_args): + buildargs=buildargs): stream = json.loads(response.decode('utf-8')) if 'stream' in stream: |
