diff options
| author | Jenkins <jenkins@review.openstack.org> | 2016-02-05 08:28:53 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2016-02-05 08:28:53 +0000 |
| commit | 16630340c74163b8d9ba5bf370a458493fb85f0f (patch) | |
| tree | 53abe7463c1f3d53f5dede54787aaf7c6678df5a /kolla | |
| parent | 28ebe4d0a2b2e6eef0e715d640855c5a9b36f461 (diff) | |
| parent | 9dae768e698bab23b093120b22739f094cd43b40 (diff) | |
| download | kolla-16630340c74163b8d9ba5bf370a458493fb85f0f.tar.gz kolla-16630340c74163b8d9ba5bf370a458493fb85f0f.zip | |
Merge "Ubuntu custom apt repos"
Diffstat (limited to 'kolla')
| -rwxr-xr-x | kolla/cmd/build.py | 14 | ||||
| -rw-r--r-- | kolla/common/config.py | 4 |
2 files changed, 17 insertions, 1 deletions
diff --git a/kolla/cmd/build.py b/kolla/cmd/build.py index 68babfa75..a127f02c8 100755 --- a/kolla/cmd/build.py +++ b/kolla/cmd/build.py @@ -410,6 +410,19 @@ class KollaWorker(object): return rpm_setup + def copy_apt_files(self): + if self.conf.apt_sources_list: + shutil.copyfile( + self.conf.apt_sources_list, + os.path.join(self.working_dir, "base", "sources.list") + ) + + if self.conf.apt_preferences: + shutil.copyfile( + self.conf.apt_preferences, + os.path.join(self.working_dir, "base", "apt_preferences") + ) + def setup_working_dir(self): """Creates a working directory for use while building""" ts = time.time() @@ -417,6 +430,7 @@ class KollaWorker(object): self.temp_dir = tempfile.mkdtemp(prefix='kolla-' + ts) self.working_dir = os.path.join(self.temp_dir, 'docker') shutil.copytree(self.images_dir, self.working_dir) + self.copy_apt_files() LOG.debug('Created working dir: %s', self.working_dir) def set_time(self): diff --git a/kolla/common/config.py b/kolla/common/config.py index 9a3da19c5..04603fc13 100644 --- a/kolla/common/config.py +++ b/kolla/common/config.py @@ -141,7 +141,9 @@ _BASE_OPTS = [ cfg.ListOpt('rpm_setup_config', default=[DELOREAN, DELOREAN_DEPS], deprecated_group='kolla-build', help=('Comma separated list of .rpm or .repo file(s) ' - 'or URL(s) to install before building containers')) + 'or URL(s) to install before building containers')), + cfg.StrOpt('apt_sources_list', help=('Path to custom sources.list')), + cfg.StrOpt('apt_preferences', help=('Path to custom apt/preferences')) ] |
