Commit 58be6624 authored by Cédric de Saint Martin's avatar Cédric de Saint Martin Committed by Marco Mariani

Raise if software_type is not mapped.

Don't have unexpected behavior and silent this error. This is bad. Bad. Bad.
parent d66f2b94
...@@ -90,12 +90,14 @@ class Recipe: ...@@ -90,12 +90,14 @@ class Recipe:
self.logger.info('Deploying instance with software type %s' % \ self.logger.info('Deploying instance with software type %s' % \
software_type) software_type)
# Raise if request software_type does not exist ...
if software_type not in self.options: if software_type not in self.options:
if 'default' in self.options: # ... Except for backward compatibility. Then use "default".
if software_type in ['RootSoftwareType']:
software_type = 'default' software_type = 'default'
else: else:
raise zc.buildout.UserError("This software type isn't mapped. And " raise zc.buildout.UserError("This software type (%s) isn't mapped." % \
"there's no default software type.") software_type)
instance_file_path = self.options[software_type] instance_file_path = self.options[software_type]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment