summaryrefslogtreecommitdiff
path: root/kolla/cmd
diff options
context:
space:
mode:
authorAllen Gao <wanlong.gao@easystack.cn>2016-02-01 20:08:57 +0800
committerJeffrey Zhang <jeffrey.zhang@99cloud.net>2016-02-04 16:48:12 +0800
commitdb53ad1ddf4f3b87582fbd2a8516b77d9c031723 (patch)
treee4afa067d83ed2d2a5fec7ecdc8210c42b4de264 /kolla/cmd
parent1057dcd50a8963e5220f7ca5cc7b66183a06340e (diff)
downloadkolla-db53ad1ddf4f3b87582fbd2a8516b77d9c031723.tar.gz
kolla-db53ad1ddf4f3b87582fbd2a8516b77d9c031723.zip
Move the install base type check to kolla-build
The install type is converted in kolla-build, so it will never fail in dockerfile, move the check to kolla-build just above the install type converting. TrivialFix Co-Authored-By: Jeffrey Zhang <jeffrey.zhang@99cloud.net> Change-Id: I1500d3b47e909f94ea9f68c5245297733f63a70b
Diffstat (limited to 'kolla/cmd')
-rwxr-xr-xkolla/cmd/build.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/kolla/cmd/build.py b/kolla/cmd/build.py
index 1e51dde75..68babfa75 100755
--- a/kolla/cmd/build.py
+++ b/kolla/cmd/build.py
@@ -64,6 +64,10 @@ class KollaUnknownBuildTypeException(Exception):
pass
+class KollaMismatchBaseTypeException(Exception):
+ pass
+
+
class KollaRpmSetupUnknownConfig(Exception):
pass
@@ -322,6 +326,17 @@ class KollaWorker(object):
rpm_setup_config = filter(None, conf.rpm_setup_config)
self.rpm_setup = self.build_rpm_setup(rpm_setup_config)
+ rh_base = ['fedora', 'centos', 'oraclelinux', 'rhel']
+ rh_type = ['source', 'binary', 'rdo', 'rhos']
+ deb_base = ['ubuntu', 'debian']
+ deb_type = ['source', 'binary']
+
+ if not ((self.base in rh_base and self.install_type in rh_type) or
+ (self.base in deb_base and self.install_type in deb_type)):
+ raise KollaMismatchBaseTypeException(
+ '{} is unavailable for {}'.format(self.install_type, self.base)
+ )
+
if self.install_type == 'binary':
self.install_metatype = 'rdo'
elif self.install_type == 'source':