Merge "Don't wait for undefined actions in SoftwareComponent"
This commit is contained in:
commit
be20bd0489
@ -248,9 +248,13 @@ class SoftwareDeployment(signal_responder.SignalResponder):
|
||||
else:
|
||||
config = {}
|
||||
|
||||
if (action not in self.properties[self.DEPLOY_ACTIONS]
|
||||
and not config.get(
|
||||
rpc_api.SOFTWARE_CONFIG_GROUP) == 'component'):
|
||||
if config.get(rpc_api.SOFTWARE_CONFIG_GROUP) == 'component':
|
||||
valid_actions = set()
|
||||
for conf in config['config']['configs']:
|
||||
valid_actions.update(conf['actions'])
|
||||
if action not in valid_actions:
|
||||
return
|
||||
elif action not in self.properties[self.DEPLOY_ACTIONS]:
|
||||
return
|
||||
|
||||
props = self._build_properties(
|
||||
|
@ -982,6 +982,43 @@ class SoftwareDeploymentTest(common.HeatTestCase):
|
||||
self.assertIsNotNone(self.deployment.handle_resume())
|
||||
self.assertIsNotNone(self.deployment.handle_delete())
|
||||
|
||||
def test_handle_unused_action_for_component(self):
|
||||
self._create_stack(self.template)
|
||||
|
||||
config = {
|
||||
'id': '48e8ade1-9196-42d5-89a2-f709fde42632',
|
||||
'group': 'component',
|
||||
'name': 'myconfig',
|
||||
'config': {
|
||||
'configs': [
|
||||
{
|
||||
'actions': ['CREATE'],
|
||||
'config': 'the config',
|
||||
'tool': 'a_tool'
|
||||
}
|
||||
]
|
||||
},
|
||||
'options': {},
|
||||
'inputs': [{
|
||||
'name': 'foo',
|
||||
'type': 'String',
|
||||
'default': 'baa',
|
||||
}, {
|
||||
'name': 'bar',
|
||||
'type': 'String',
|
||||
'default': 'baz',
|
||||
}],
|
||||
'outputs': [],
|
||||
}
|
||||
self.rpc_client.show_software_config.return_value = config
|
||||
sd = self.mock_deployment()
|
||||
|
||||
self.rpc_client.show_software_deployment.return_value = sd
|
||||
self.deployment.resource_id = sd['id']
|
||||
|
||||
self.assertIsNotNone(self.deployment.handle_create())
|
||||
self.assertIsNone(self.deployment.handle_delete())
|
||||
|
||||
def test_get_temp_url(self):
|
||||
dep_data = {}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user