Fix the error reporting.

- Don't return a dict error
- in manager return full response
- return the result in Resource.validate()

Change-Id: I585ea9dd9cf747927fb4effb90cfff49cba20931
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
changes/73/173/1
Angus Salkeld 10 years ago
parent 1fc9ff4a0b
commit f45d436263
  1. 6
      heat/engine/checkeddict.py
  2. 2
      heat/engine/manager.py
  3. 2
      heat/engine/parser.py
  4. 4
      heat/engine/resources.py

@ -154,11 +154,9 @@ class Properties(CheckedDict):
if 'Required' in self.data[key]:
if self.data[key]['Required'] \
and not 'Value' in self.data[key]:
return {'Error':
'%s Property must be provided' % key}
return '%s Property must be provided' % key
# are there unimplemented Properties
if not self.data[key]['Implemented'] and 'Value' in self.data[key]:
return {'Error':
'%s Property not implemented yet' % key}
return '%s Property not implemented yet' % key
return None

@ -203,7 +203,7 @@ class EngineManager(manager.Manager):
template_copy = None
if 'Malformed Query Response' in \
response['ValidateTemplateResult']['Description']:
return response['ValidateTemplateResult']['Description']
return response
stack = parser.Stack(context, stack_name, template, 0, params,
metadata_server=metadata_server)

@ -103,7 +103,7 @@ class Stack(object):
res = str(ex)
finally:
if res:
err_str = 'Malformed Query Response [%s]' % (res)
err_str = 'Malformed Query Response %s' % (res)
response = {'ValidateTemplateResult': {
'Description': err_str,
'Parameters': []}}

@ -128,8 +128,8 @@ class Resource(object):
try:
self.calculate_properties()
except ValueError as ex:
return {'Error': '%s' % str(ex)}
self.properties.validate()
return str(ex)
return self.properties.validate()
def instance_id_set(self, inst):
self.instance_id = inst

Loading…
Cancel
Save