2015-05-14 07:40:47 |
huangtianhua |
description |
Test the blueprint: https://blueprints.launchpad.net/heat/+spec/stack-breakpoint
1. set hooks for resource breakpoint in environment file:
resource_registry:
resources:
my_server:
hooks: ['pre-update', 'pre-invalid']
2. the engine can't start, AttributeError raised, the details see: http://paste.openstack.org/show/215958/
3. find the reason is that if it's hook definition but the type is invalid, then will enter 'else' flow to register
************
def _load_registry(self, path, registry):
for k, v in iter(registry.items()):
if v is None:
self._register_info(path + [k], None)
elif is_hook_definition(k, v):
self._register_hook(path + [k], v)
elif isinstance(v, dict):
self._load_registry(path + [k], v)
else:
self._register_info(path + [k],
ResourceInfo(self, path + [k], v))
*************
I think if it's hook definition but the hook is invalid, we should raise exception such as 'Invalid hook type for resource breakpoint'. |
Test the blueprint: https://blueprints.launchpad.net/heat/+spec/stack-breakpoint
1. set hooks for resource breakpoint in environment file:
resource_registry:
resources:
my_server:
hooks: pre-cre
2. expected to pause on server creation, but nothing happen and no pause, and user may don't know why
3. I think if hooks are invalid, we should raise error message to user, such as 'Invalid hook type "pre-cre" for resource breakpoint, acceptable hooks: "pre-create", "pre-update"', then user will know what happen. |
|