aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHui Kang <kangh@us.ibm.com>2015-11-04 13:03:43 -0500
committerHui Kang <kangh@us.ibm.com>2015-11-22 00:10:00 -0500
commite88e9bd29c81001784f99314bd007af80b931b55 (patch)
tree6cd63d0163cec9def1907fe1de9ffd4fadb09911
parent42b9660c7c081334ae7f13956a1b605308acb66d (diff)
downloadkolla-e88e9bd29c81001784f99314bd007af80b931b55.tar.gz
kolla-e88e9bd29c81001784f99314bd007af80b931b55.zip
Add error handler for unknown build type
Change-Id: Ia5d9ad1ffa119c2dd3e74272df3fb6d78501ec09 closes-Bug: #1513175
-rwxr-xr-xkolla/cmd/build.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/kolla/cmd/build.py b/kolla/cmd/build.py
index 7fb0f8145..9ad7104c0 100755
--- a/kolla/cmd/build.py
+++ b/kolla/cmd/build.py
@@ -47,6 +47,10 @@ class KollaDirNotFoundException(Exception):
pass
+class KollaUnknownBuildTypeException(Exception):
+ pass
+
+
class WorkerThread(Thread):
def __init__(self, queue, config):
@@ -260,7 +264,8 @@ def merge_args_and_config(settings_from_config_file):
help='The base distro image tag',
type=str)
parser.add_argument('-t', '--type',
- help='The method of the Openstack install',
+ help='The method of the Openstack install: binary,'
+ ' source, rdo, or rhos',
type=str,
dest='install_type')
parser.add_argument('--no-cache',
@@ -339,6 +344,10 @@ class KollaWorker(object):
elif self.install_type == 'rhos':
self.install_type = 'binary'
self.install_metatype = 'rhos'
+ else:
+ raise KollaUnknownBuildTypeException(
+ 'Unknown install type'
+ )
self.image_prefix = self.base + '-' + self.install_type + '-'