Raise an AttributeError instead of returning a string when passed
an incorrect stack name, this then maps to the appropriate error
in the API.
Fixes #182
Change-Id: I7fe80496883bfbe515d9c235de812aaa14c41c12
Signed-off-by: Steven Hardy <shardy@redhat.com>
auth.authenticate(context)
if db_api.stack_get_by_name(None, stack_name):
- return {'Error': 'Stack already exists with that name.'}
+ raise AttributeError('Stack already exists with that name')
tmpl = parser.Template(template)
# Get the database representation of the existing stack
db_stack = db_api.stack_get_by_name(None, stack_name)
if not db_stack:
- return {'Error': 'No stack exists with that name.'}
+ raise AttributeError('No stack exists with that name')
current_stack = parser.Stack.load(context, db_stack.id)