From 2731d3da4f750307910dfd74fd6e646e587f9da0 Mon Sep 17 00:00:00 2001 From: ricolin Date: Tue, 17 Apr 2018 14:25:13 +0800 Subject: [PATCH] Fix external_validate for Heat resources External validate use _show_resource to check if Stack resource exists. Witout entity name and default client name, the validation will just pass. Add entity name to `OS::Heat::Stack` Add entity and default client name to `OS::Heat::SoftwareConfig` and `OS::Heat::SoftwareDeployment` Story: #1764947 Task: #17359 Change-Id: Ia0864aacf2951c711e99ce2c687f47af421110be --- heat/engine/resources/openstack/heat/remote_stack.py | 2 ++ heat/engine/resources/openstack/heat/software_config.py | 4 ++++ heat/engine/resources/openstack/heat/software_deployment.py | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/heat/engine/resources/openstack/heat/remote_stack.py b/heat/engine/resources/openstack/heat/remote_stack.py index 532b1a4bc9..189133a433 100644 --- a/heat/engine/resources/openstack/heat/remote_stack.py +++ b/heat/engine/resources/openstack/heat/remote_stack.py @@ -73,6 +73,8 @@ class RemoteStack(resource.Resource): """ default_client_name = 'heat' + entity = 'stacks' + PROPERTIES = ( CONTEXT, TEMPLATE, TIMEOUT, PARAMETERS, ) = ( diff --git a/heat/engine/resources/openstack/heat/software_config.py b/heat/engine/resources/openstack/heat/software_config.py index b03d9b9172..1dcc6ed5c5 100644 --- a/heat/engine/resources/openstack/heat/software_config.py +++ b/heat/engine/resources/openstack/heat/software_config.py @@ -44,6 +44,10 @@ class SoftwareConfig(resource.Resource): support_status = support.SupportStatus(version='2014.1') + default_client_name = 'heat' + + entity = 'software_configs' + PROPERTIES = ( GROUP, CONFIG, OPTIONS, diff --git a/heat/engine/resources/openstack/heat/software_deployment.py b/heat/engine/resources/openstack/heat/software_deployment.py index 2e2b6b34cd..09c6627129 100644 --- a/heat/engine/resources/openstack/heat/software_deployment.py +++ b/heat/engine/resources/openstack/heat/software_deployment.py @@ -72,6 +72,10 @@ class SoftwareDeployment(signal_responder.SignalResponder): support_status = support.SupportStatus(version='2014.1') + default_client_name = 'heat' + + entity = 'software_deployments' + PROPERTIES = ( CONFIG, SERVER, INPUT_VALUES, DEPLOY_ACTIONS, NAME, SIGNAL_TRANSPORT