Add error handler for unknown build type

Change-Id: Ia5d9ad1ffa119c2dd3e74272df3fb6d78501ec09
closes-Bug: #1513175
This commit is contained in:
Hui Kang 2015-11-04 13:03:43 -05:00
parent 42b9660c7c
commit e88e9bd29c

View File

@ -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 + '-'