aboutsummaryrefslogtreecommitdiff
path: root/kolla
diff options
context:
space:
mode:
authorSamYaple <sam@yaple.net>2016-02-03 01:06:36 +0000
committerSamYaple <sam@yaple.net>2016-02-03 15:56:54 +0000
commit9dae768e698bab23b093120b22739f094cd43b40 (patch)
treef8499379ef2a1398426d0dd59f25e71dee3b9596 /kolla
parent0f002cfff7900317d2eb089a9d2f4afe4a5469fe (diff)
downloadkolla-9dae768e698bab23b093120b22739f094cd43b40.tar.gz
kolla-9dae768e698bab23b093120b22739f094cd43b40.zip
Ubuntu custom apt repos
Change-Id: I3afb8a29c4ae2369f29e0cc94d75ff8a3c42594b Implements: blueprint custom-repos
Diffstat (limited to 'kolla')
-rwxr-xr-xkolla/cmd/build.py14
-rw-r--r--kolla/common/config.py4
2 files changed, 17 insertions, 1 deletions
diff --git a/kolla/cmd/build.py b/kolla/cmd/build.py
index 1e51dde75..7d94d3ae6 100755
--- a/kolla/cmd/build.py
+++ b/kolla/cmd/build.py
@@ -395,6 +395,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()
@@ -402,6 +415,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'))
]