self.stack.resolve_runtime_data,
self.name)
properties.validate()
+ tmpl_diff = self.update_template_diff(json_snippet)
+ prop_diff = self.update_template_diff_properties(json_snippet)
if callable(getattr(self, 'handle_update', None)):
- result = self.handle_update(json_snippet)
+ result = self.handle_update(json_snippet, tmpl_diff, prop_diff)
except UpdateReplace:
logger.debug("Resource %s update requires replacement" % self.name)
raise
'''
return base64.b64encode(data)
- def handle_update(self, json_snippet=None):
+ def handle_update(self, json_snippet=None, tmpl_diff=None, prop_diff=None):
raise UpdateReplace(self.name)
def metadata_update(self, new_metadata=None):
if creator is not None:
creator.run_to_completion()
- def handle_update(self, json_snippet):
- tmpl_diff = self.update_template_diff(json_snippet)
- prop_diff = self.update_template_diff_properties(json_snippet)
-
+ def handle_update(self, json_snippet, tmpl_diff, prop_diff):
# If Properties has changed, update self.properties, so we
# get the new values during any subsequent adjustment
if prop_diff:
return self._adjust(num_to_create)
- def handle_update(self, json_snippet):
- tmpl_diff = self.update_template_diff(json_snippet)
- prop_diff = self.update_template_diff_properties(json_snippet)
-
+ def handle_update(self, json_snippet, tmpl_diff, prop_diff):
# If Properties has changed, update self.properties, so we
# get the new values during any subsequent adjustment
if prop_diff:
def __init__(self, name, json_snippet, stack):
super(ScalingPolicy, self).__init__(name, json_snippet, stack)
- def handle_update(self, json_snippet):
- tmpl_diff = self.update_template_diff(json_snippet)
- prop_diff = self.update_template_diff_properties(json_snippet)
-
+ def handle_update(self, json_snippet, tmpl_diff, prop_diff):
# If Properties has changed, update self.properties, so we
# get the new values during any subsequent adjustment
if prop_diff:
stack_id=self.stack.id)
wr.store()
- def handle_update(self, json_snippet):
- self.update_template_diff(json_snippet)
- prop_diff = self.update_template_diff_properties(json_snippet)
-
+ def handle_update(self, json_snippet, tmpl_diff, prop_diff):
# If Properties has changed, update self.properties, so we
# get the new values during any subsequent adjustment
if prop_diff:
vol['VolumeId'])
scheduler.TaskRunner(detach_task)()
- def handle_update(self, json_snippet):
- tmpl_diff = self.update_template_diff(json_snippet)
-
+ def handle_update(self, json_snippet, tmpl_diff, prop_diff):
if 'Metadata' in tmpl_diff:
self.metadata = tmpl_diff.get('Metadata', {})
def handle_create(self):
logger.warning('Creating generic resource (Type "%s")' % self.type())
- def handle_update(self, json_snippet=None):
+ def handle_update(self, json_snippet, tmpl_diff, prop_diff):
logger.warning('Updating generic resource (Type "%s")' % self.type())
for x in range(nmeta):
Metadata.__set__(mox.IgnoreArg(), expected).AndReturn(None)
- def test_scaling_group_update(self):
+ def test_scaling_group_update_replace(self):
t = template_format.parse(as_template)
stack = parse_stack(t)
self.assertEqual('WebServerGroup', rsrc.FnGetRefId())
self.assertEqual('WebServerGroup-0', rsrc.resource_id)
+ update_snippet = copy.deepcopy(rsrc.parsed_template())
+ update_snippet['Properties']['LaunchConfigurationName'] = 'foo'
self.assertRaises(resource.UpdateReplace,
- rsrc.handle_update, {})
+ rsrc.update, update_snippet)
rsrc.delete()
self.m.VerifyAll()
# Reduce the max size to 2, should complete without adjusting
update_snippet = copy.deepcopy(rsrc.parsed_template())
update_snippet['Properties']['MaxSize'] = '2'
- self.assertEqual(None, rsrc.handle_update(update_snippet))
+ self.assertEqual(None, rsrc.update(update_snippet))
self.assertEqual('WebServerGroup-0', rsrc.resource_id)
+ self.assertEqual('2', rsrc.properties['MaxSize'])
+
rsrc.delete()
self.m.VerifyAll()
update_snippet = copy.deepcopy(rsrc.parsed_template())
update_snippet['Properties']['MinSize'] = '2'
- self.assertEqual(None, rsrc.handle_update(update_snippet))
+ self.assertEqual(None, rsrc.update(update_snippet))
self.assertEqual('WebServerGroup-0,WebServerGroup-1',
rsrc.resource_id)
+ self.assertEqual('2', rsrc.properties['MinSize'])
rsrc.delete()
self.m.VerifyAll()
update_snippet = copy.deepcopy(rsrc.parsed_template())
update_snippet['Properties']['DesiredCapacity'] = '2'
- self.assertEqual(None, rsrc.handle_update(update_snippet))
+ self.assertEqual(None, rsrc.update(update_snippet))
self.assertEqual('WebServerGroup-0,WebServerGroup-1',
rsrc.resource_id)
+ self.assertEqual('2', rsrc.properties['DesiredCapacity'])
+
rsrc.delete()
self.m.VerifyAll()
# have no effect, it's an optional parameter
update_snippet = copy.deepcopy(rsrc.parsed_template())
del(update_snippet['Properties']['DesiredCapacity'])
- self.assertEqual(None, rsrc.handle_update(update_snippet))
+ self.assertEqual(None, rsrc.update(update_snippet))
self.assertEqual('WebServerGroup-0,WebServerGroup-1',
rsrc.resource_id)
+ self.assertEqual(None, rsrc.properties['DesiredCapacity'])
+
rsrc.delete()
self.m.VerifyAll()
self.assertEqual('WebServerGroup-0', rsrc.resource_id)
update_snippet = copy.deepcopy(rsrc.parsed_template())
update_snippet['Properties']['Cooldown'] = '61'
- self.assertEqual(None, rsrc.handle_update(update_snippet))
+ self.assertEqual(None, rsrc.update(update_snippet))
+ self.assertEqual('61', rsrc.properties['Cooldown'])
rsrc.delete()
self.m.VerifyAll()
# Update scaling policy
update_snippet = copy.deepcopy(up_policy.parsed_template())
update_snippet['Properties']['ScalingAdjustment'] = '2'
- self.assertEqual(None,
- up_policy.handle_update(update_snippet))
+ self.assertEqual(None, up_policy.update(update_snippet))
self.assertEqual('2',
up_policy.properties['ScalingAdjustment'])
snippet['Properties']['Statistic'] = 'Maximum'
snippet['Properties']['Threshold'] = '39'
- self.assertEqual(None, rsrc.handle_update(snippet))
+ self.assertEqual(None, rsrc.update(snippet))
rsrc.delete()
self.m.VerifyAll()
snippet['Properties']['MetricName'] = 'temp'
self.assertRaises(resource.UpdateReplace,
- rsrc.handle_update, snippet)
+ rsrc.update, snippet)
rsrc.delete()
self.m.VerifyAll()
self.assertEqual('1', rsrc.FnGetAtt('AllocationId'))
self.assertRaises(resource.UpdateReplace,
- rsrc.handle_update, {})
+ rsrc.handle_update, {}, {}, {})
self.assertRaises(eip.exception.InvalidTemplateAttribute,
rsrc.FnGetAtt, 'Foo')
self.assertEqual('JobServerGroup', rsrc.FnGetRefId())
self.assertEqual('1.2.3.4', rsrc.FnGetAtt('InstanceList'))
self.assertEqual('JobServerGroup-0', rsrc.resource_id)
- self.assertRaises(resource.UpdateReplace,
- rsrc.handle_update, {})
rsrc.delete()
self.m.VerifyAll()
self.m.VerifyAll()
- def test_update_size(self):
+ def test_handle_update_size(self):
t = template_format.parse(ig_template)
properties = t['Resources']['JobServerGroup']['Properties']
properties['Size'] = '2'
update_snippet = copy.deepcopy(rsrc.parsed_template())
update_snippet['Properties']['Size'] = '5'
- self.assertEqual(None, rsrc.handle_update(update_snippet))
+ tmpl_diff = {'Properties': {'Size': '5'}}
+ prop_diff = {'Size': '5'}
+ self.assertEqual(None, rsrc.handle_update(update_snippet, tmpl_diff,
+ prop_diff))
assert_str = ','.join(['JobServerGroup-%s' % x for x in range(5)])
self.assertEqual(assert_str,
rsrc.resource_id)
rsrc.delete()
self.m.VerifyAll()
+
+ def test_update_fail_badkey(self):
+ t = template_format.parse(ig_template)
+ properties = t['Resources']['JobServerGroup']['Properties']
+ properties['Size'] = '2'
+ stack = parse_stack(t)
+
+ self._stub_create(2)
+ self.m.ReplayAll()
+ rsrc = self.create_instance_group(t, stack, 'JobServerGroup')
+ self.assertEqual('JobServerGroup-0,JobServerGroup-1',
+ rsrc.resource_id)
+
+ self.m.ReplayAll()
+
+ update_snippet = copy.deepcopy(rsrc.parsed_template())
+ update_snippet['Metadata'] = 'notallowedforupdate'
+ self.assertRaises(resource.UpdateReplace,
+ rsrc.update, update_snippet)
+
+ rsrc.delete()
+ self.m.VerifyAll()
+
+ def test_update_fail_badprop(self):
+ t = template_format.parse(ig_template)
+ properties = t['Resources']['JobServerGroup']['Properties']
+ properties['Size'] = '2'
+ stack = parse_stack(t)
+
+ self._stub_create(2)
+ self.m.ReplayAll()
+ rsrc = self.create_instance_group(t, stack, 'JobServerGroup')
+ self.assertEqual('JobServerGroup-0,JobServerGroup-1',
+ rsrc.resource_id)
+
+ self.m.ReplayAll()
+
+ update_snippet = copy.deepcopy(rsrc.parsed_template())
+ update_snippet['Properties']['LaunchConfigurationName'] = 'wibble'
+ self.assertRaises(resource.UpdateReplace,
+ rsrc.update, update_snippet)
+
+ rsrc.delete()
+ self.m.VerifyAll()
pass
self.assertRaises(resource.UpdateReplace,
- rsrc.handle_update, {})
+ rsrc.handle_update, {}, {}, {})
self.m.VerifyAll()
'arn:openstack:heat::aaaa:stacks/test_stack.the_nested/'))
self.assertRaises(resource.UpdateReplace,
- rsrc.handle_update, {})
+ rsrc.handle_update, {}, {}, {})
self.assertEqual('bar', rsrc.FnGetAtt('Outputs.Foo'))
self.assertRaises(
updated_stack = parser.Stack(self.ctx, 'updated_stack',
template.Template(tmpl2))
- # patch in a dummy handle_update
- self.m.StubOutWithMock(generic_rsrc.GenericResource, 'handle_update')
- generic_rsrc.GenericResource.handle_update(
- tmpl2['Resources']['AResource']).AndRaise(
- resource.UpdateReplace)
+
+ # Calls to GenericResource.handle_update will raise
+ # resource.UpdateReplace because we've not specified the modified
+ # key/property in update_allowed_keys/update_allowed_properties
self.m.ReplayAll()
self.stack.update(updated_stack)
self.stack.create()
self.assertEqual(self.stack.state, parser.Stack.CREATE_COMPLETE)
+ res = self.stack['AResource']
+ res.update_allowed_keys = ('Properties',)
+ res.update_allowed_properties = ('Foo',)
+
tmpl2 = {'Resources': {'AResource': {'Type': 'GenericResourceType',
'Properties': {'Foo': 'xyz'}}}}
# patch in a dummy handle_update
self.m.StubOutWithMock(generic_rsrc.GenericResource, 'handle_update')
+ tmpl_diff = {'Properties': {'Foo': 'xyz'}}
+ prop_diff = {'Foo': 'xyz'}
generic_rsrc.GenericResource.handle_update(
- tmpl2['Resources']['AResource']).AndRaise(Exception("Foo"))
+ tmpl2['Resources']['AResource'], tmpl_diff,
+ prop_diff).AndRaise(Exception("Foo"))
self.m.ReplayAll()
self.stack.update(updated_stack)
updated_stack = parser.Stack(self.ctx, 'updated_stack',
template.Template(tmpl2))
- # patch in a dummy handle_update
- self.m.StubOutWithMock(generic_rsrc.GenericResource, 'handle_update')
- generic_rsrc.GenericResource.handle_update(
- tmpl2['Resources']['AResource']).AndRaise(
- resource.UpdateReplace)
+ # Calls to GenericResource.handle_update will raise
+ # resource.UpdateReplace because we've not specified the modified
+ # key/property in update_allowed_keys/update_allowed_properties
# make the update fail deleting the existing resource
self.m.StubOutWithMock(resource.Resource, 'destroy')
updated_stack = parser.Stack(self.ctx, 'updated_stack',
template.Template(tmpl2))
- # patch in a dummy handle_update
- self.m.StubOutWithMock(generic_rsrc.GenericResource, 'handle_update')
- generic_rsrc.GenericResource.handle_update(
- tmpl2['Resources']['AResource']).AndRaise(
- resource.UpdateReplace)
+ # Calls to GenericResource.handle_update will raise
+ # resource.UpdateReplace because we've not specified the modified
+ # key/property in update_allowed_keys/update_allowed_properties
# patch in a dummy handle_create making the replace fail creating
self.m.StubOutWithMock(generic_rsrc.GenericResource, 'handle_create')
updated_stack = parser.Stack(self.ctx, 'updated_stack',
template.Template(tmpl2))
- # There will be two calls to handle_update, one for the new template
- # then another (with the initial template) for rollback
- self.m.StubOutWithMock(generic_rsrc.GenericResource, 'handle_update')
- generic_rsrc.GenericResource.handle_update(
- tmpl2['Resources']['AResource']).AndRaise(
- resource.UpdateReplace)
- generic_rsrc.GenericResource.handle_update(
- tmpl['Resources']['AResource']).AndRaise(
- resource.UpdateReplace)
+ # Calls to GenericResource.handle_update will raise
+ # resource.UpdateReplace because we've not specified the modified
+ # key/property in update_allowed_keys/update_allowed_properties
# patch in a dummy handle_create making the replace fail when creating
# the replacement rsrc, but succeed the second call (rollback)
updated_stack = parser.Stack(self.ctx, 'updated_stack',
template.Template(tmpl2))
- # There will be two calls to handle_update, one for the new template
- # then another (with the initial template) for rollback
- self.m.StubOutWithMock(generic_rsrc.GenericResource, 'handle_update')
- generic_rsrc.GenericResource.handle_update(
- tmpl2['Resources']['AResource']).AndRaise(
- resource.UpdateReplace)
- generic_rsrc.GenericResource.handle_update(
- tmpl['Resources']['AResource']).AndRaise(
- resource.UpdateReplace)
+ # Calls to GenericResource.handle_update will raise
+ # resource.UpdateReplace because we've not specified the modified
+ # key/property in update_allowed_keys/update_allowed_properties
# patch in a dummy handle_create making the replace fail when creating
# the replacement rsrc, and again on the second call (rollback)
self.assertEqual(self.stack['BResource'].properties['Foo'],
'AResource')
- self.m.StubOutWithMock(generic_rsrc.GenericResource, 'handle_update')
- generic_rsrc.GenericResource.handle_update(
- tmpl2['Resources']['AResource']).AndRaise(
- resource.UpdateReplace)
-
- br2_snip = {'Type': 'GenericResourceType',
- 'Properties': {'Foo': 'inst-007'}}
- generic_rsrc.GenericResource.handle_update(
- br2_snip).AndRaise(resource.UpdateReplace)
+ # Calls to GenericResource.handle_update will raise
+ # resource.UpdateReplace because we've not specified the modified
+ # key/property in update_allowed_keys/update_allowed_properties
self.m.StubOutWithMock(generic_rsrc.GenericResource, 'FnGetRefId')
generic_rsrc.GenericResource.FnGetRefId().AndReturn(
self.assertEqual(self.stack['BResource'].properties['Foo'],
'AResource')
- self.m.StubOutWithMock(generic_rsrc.GenericResource, 'handle_update')
self.m.StubOutWithMock(generic_rsrc.GenericResource, 'FnGetRefId')
self.m.StubOutWithMock(generic_rsrc.GenericResource, 'handle_create')
- # mocks for first (failed update)
- generic_rsrc.GenericResource.handle_update(
- tmpl2['Resources']['AResource']).AndRaise(
- resource.UpdateReplace)
+ # Calls to GenericResource.handle_update will raise
+ # resource.UpdateReplace because we've not specified the modified
+ # key/property in update_allowed_keys/update_allowed_properties
+
generic_rsrc.GenericResource.FnGetRefId().AndReturn(
'AResource')
# mock to make the replace fail when creating the replacement resource
generic_rsrc.GenericResource.handle_create().AndRaise(Exception)
- # mocks for second rollback update
- generic_rsrc.GenericResource.handle_update(
- tmpl['Resources']['AResource']).AndRaise(
- resource.UpdateReplace)
-
generic_rsrc.GenericResource.handle_create().AndReturn(None)
generic_rsrc.GenericResource.FnGetRefId().MultipleTimes().AndReturn(
'AResource')
self.assertEqual(self.stack['BResource'].properties['Foo'],
'AResource')
- self.m.StubOutWithMock(generic_rsrc.GenericResource, 'handle_update')
self.m.StubOutWithMock(generic_rsrc.GenericResource, 'FnGetRefId')
self.m.StubOutWithMock(generic_rsrc.GenericResource, 'handle_create')
- # mocks for first and second (failed update)
- generic_rsrc.GenericResource.handle_update(
- tmpl2['Resources']['AResource']).AndRaise(
- resource.UpdateReplace)
- br2_snip = {'Type': 'GenericResourceType',
- 'Properties': {'Foo': 'inst-007'}}
- generic_rsrc.GenericResource.handle_update(
- br2_snip).AndRaise(resource.UpdateReplace)
+ # Calls to GenericResource.handle_update will raise
+ # resource.UpdateReplace because we've not specified the modified
+ # key/property in update_allowed_keys/update_allowed_properties
generic_rsrc.GenericResource.FnGetRefId().AndReturn(
'AResource')
generic_rsrc.GenericResource.handle_create().AndReturn(None)
generic_rsrc.GenericResource.handle_create().AndRaise(Exception)
- # mocks for second rollback update
- generic_rsrc.GenericResource.handle_update(
- tmpl['Resources']['AResource']).AndRaise(
- resource.UpdateReplace)
- br2_snip = {'Type': 'GenericResourceType',
- 'Properties': {'Foo': 'AResource'}}
- generic_rsrc.GenericResource.handle_update(
- br2_snip).AndRaise(resource.UpdateReplace)
+ # Calls to GenericResource.handle_update will raise
+ # resource.UpdateReplace because we've not specified the modified
+ # key/property in update_allowed_keys/update_allowed_properties
# self.state_set(self.DELETE_IN_PROGRESS)
generic_rsrc.GenericResource.FnGetRefId().AndReturn(
rsrc.FnGetAtt('id'))
self.assertRaises(resource.UpdateReplace,
- rsrc.handle_update, {})
+ rsrc.handle_update, {}, {}, {})
rsrc.delete()
rsrc.state_set(rsrc.CREATE_COMPLETE, 'to delete again')
rsrc.FnGetAtt('id'))
self.assertRaises(resource.UpdateReplace,
- rsrc.handle_update, {})
+ rsrc.handle_update, {}, {}, {})
self.assertEqual(rsrc.delete(), None)
rsrc.state_set(rsrc.CREATE_COMPLETE, 'to delete again')
rsrc.FnGetAtt('id'))
self.assertRaises(resource.UpdateReplace,
- rsrc.handle_update, {})
+ rsrc.handle_update, {}, {}, {})
self.assertEqual(rsrc.delete(), None)
rsrc.state_set(rsrc.CREATE_COMPLETE, 'to delete again')
self.assertEqual('fc68ea2c-b60b-4b4f-bd82-94ec81110766',
fip.FnGetAtt('id'))
self.assertRaises(resource.UpdateReplace,
- fip.handle_update, {})
+ fip.handle_update, {}, {}, {})
self.assertEqual(fip.delete(), None)
fip.state_set(fip.CREATE_COMPLETE, 'to delete again')
self.assertEqual(fip.delete(), None)
p.FnGetAtt('id'))
self.assertRaises(resource.UpdateReplace,
- p.handle_update, {})
+ p.handle_update, {}, {}, {})
self.m.VerifyAll()
port_id = p.FnGetRefId()
self.assertEqual('%s:%s' % (fip_id, port_id), fipa_id)
self.assertRaises(resource.UpdateReplace,
- fipa.handle_update, {})
+ fipa.handle_update, {}, {}, {})
self.assertEqual(fipa.delete(), None)
self.assertEqual(p.delete(), None)
tmpl = {'Type': 'GenericResourceType', 'Properties': {'Foo': 'abc'}}
res = generic_rsrc.GenericResource('test_resource', tmpl, self.stack)
+ res.update_allowed_keys = ('Properties',)
+ res.update_allowed_properties = ('Foo',)
scheduler.TaskRunner(res.create)()
self.assertEqual(res.CREATE_COMPLETE, res.state)
utmpl = {'Type': 'GenericResourceType', 'Properties': {'Foo': 'xyz'}}
+ tmpl_diff = {'Properties': {'Foo': 'xyz'}}
+ prop_diff = {'Foo': 'xyz'}
self.m.StubOutWithMock(generic_rsrc.GenericResource, 'handle_update')
- generic_rsrc.GenericResource.handle_update(utmpl).AndReturn(None)
+ generic_rsrc.GenericResource.handle_update(
+ utmpl, tmpl_diff, prop_diff).AndReturn(None)
self.m.ReplayAll()
self.assertEqual(None, res.update(utmpl))
tmpl = {'Type': 'GenericResourceType', 'Properties': {'Foo': 'abc'}}
res = generic_rsrc.GenericResource('test_resource', tmpl, self.stack)
+ res.update_allowed_keys = ('Properties',)
+ res.update_allowed_properties = ('Foo',)
scheduler.TaskRunner(res.create)()
self.assertEqual(res.CREATE_COMPLETE, res.state)
utmpl = {'Type': 'GenericResourceType', 'Properties': {'Foo': 'xyz'}}
self.m.StubOutWithMock(generic_rsrc.GenericResource, 'handle_update')
- generic_rsrc.GenericResource.handle_update(utmpl).AndRaise(
- resource.UpdateReplace())
+ tmpl_diff = {'Properties': {'Foo': 'xyz'}}
+ prop_diff = {'Foo': 'xyz'}
+ generic_rsrc.GenericResource.handle_update(
+ utmpl, tmpl_diff, prop_diff).AndRaise(resource.UpdateReplace())
self.m.ReplayAll()
# should be re-raised so parser.Stack can handle replacement
self.assertRaises(resource.UpdateReplace, res.update, utmpl)
tmpl = {'Type': 'GenericResourceType', 'Properties': {'Foo': 'abc'}}
res = generic_rsrc.GenericResource('test_resource', tmpl, self.stack)
+ res.update_allowed_keys = ('Properties',)
+ res.update_allowed_properties = ('Foo',)
scheduler.TaskRunner(res.create)()
self.assertEqual(res.CREATE_COMPLETE, res.state)
tmpl = {'Type': 'GenericResourceType', 'Properties': {'Foo': 'abc'}}
res = generic_rsrc.GenericResource('test_resource', tmpl, self.stack)
+ res.update_allowed_keys = ('Properties',)
+ res.update_allowed_properties = ('Foo',)
scheduler.TaskRunner(res.create)()
self.assertEqual(res.CREATE_COMPLETE, res.state)
tmpl = {'Type': 'GenericResourceType', 'Properties': {'Foo': 'abc'}}
res = generic_rsrc.GenericResource('test_resource', tmpl, self.stack)
+ res.update_allowed_keys = ('Properties',)
+ res.update_allowed_properties = ('Foo',)
scheduler.TaskRunner(res.create)()
self.assertEqual(res.CREATE_COMPLETE, res.state)
utmpl = {'Type': 'GenericResourceType', 'Properties': {'Foo': 'xyz'}}
+ tmpl_diff = {'Properties': {'Foo': 'xyz'}}
+ prop_diff = {'Foo': 'xyz'}
self.m.StubOutWithMock(generic_rsrc.GenericResource, 'handle_update')
- generic_rsrc.GenericResource.handle_update(utmpl).AndRaise(
- NotImplemented)
+ generic_rsrc.GenericResource.handle_update(utmpl, tmpl_diff, prop_diff
+ ).AndRaise(NotImplemented)
self.m.ReplayAll()
self.assertRaises(exception.ResourceFailure, res.update, utmpl)
self.assertEqual(res.UPDATE_FAILED, res.state)
pass
self.assertRaises(resource.UpdateReplace,
- rsrc.handle_update, {})
+ rsrc.handle_update, {}, {}, {})
rsrc.delete()
self.m.VerifyAll()
stack = self.create_stack(self.test_template_nova)
sg = stack['the_sg']
- self.assertRaises(resource.UpdateReplace, sg.handle_update, {})
+ self.assertRaises(resource.UpdateReplace, sg.handle_update, {}, {}, {})
self.assertResourceState(sg, 'the_sg')
stack = self.create_stack(self.test_template_nova)
sg = stack['the_sg']
- self.assertRaises(resource.UpdateReplace, sg.handle_update, {})
+ self.assertRaises(resource.UpdateReplace, sg.handle_update, {}, {}, {})
self.assertResourceState(sg, 'the_sg')
stack = self.create_stack(self.test_template_quantum)
sg = stack['the_sg']
- self.assertRaises(resource.UpdateReplace, sg.handle_update, {})
+ self.assertRaises(resource.UpdateReplace, sg.handle_update, {}, {}, {})
self.assertResourceState(sg, 'the_sg')
stack = self.create_stack(self.test_template_quantum)
sg = stack['the_sg']
- self.assertRaises(resource.UpdateReplace, sg.handle_update, {})
+ self.assertRaises(resource.UpdateReplace, sg.handle_update, {}, {}, {})
self.assertResourceState(sg, 'the_sg')
pass
self.assertRaises(resource.UpdateReplace,
- rsrc.handle_update, {})
+ rsrc.handle_update, {}, {}, {})
rsrc.delete()
self.m.VerifyAll()
self.assertEqual('CREATE_COMPLETE', rsrc.state)
self.assertRaises(resource.UpdateReplace,
- rsrc.handle_update, {})
+ rsrc.handle_update, {}, {}, {})
rsrc.resource_id = None
self.assertEqual(None, rsrc.delete())
rsrc = self.create_access_key(t, stack, 'HostKeys')
self.assertRaises(resource.UpdateReplace,
- rsrc.handle_update, {})
+ rsrc.handle_update, {}, {}, {})
self.assertEqual(self.fc.access,
rsrc.resource_id)
t['Resources'][resource_name],
stack)
self.assertRaises(resource.UpdateReplace,
- rsrc.handle_update, {})
+ rsrc.handle_update, {}, {}, {})
def test_accesspolicy_access_allowed(self):
t = template_format.parse(user_policy_template)
self.assertEqual(fv.status, 'available')
self.assertRaises(resource.UpdateReplace,
- rsrc.handle_update, {})
+ rsrc.handle_update, {}, {}, {})
fv.status = 'in-use'
self.assertRaises(exception.ResourceFailure, rsrc.destroy)
rsrc = self.create_attachment(t, stack, 'MountPoint')
self.assertRaises(resource.UpdateReplace,
- rsrc.handle_update, {})
+ rsrc.handle_update, {}, {}, {})
self.assertEqual(rsrc.delete(), None)
scheduler.TaskRunner(rsrc.create)()
self.assertEqual(rsrc.state, vol.VolumeAttachment.CREATE_COMPLETE)
- self.assertRaises(resource.UpdateReplace, rsrc.handle_update, {})
+ self.assertRaises(resource.UpdateReplace, rsrc.handle_update,
+ {}, {}, {})
self.assertEqual(rsrc.delete(), None)
'router_id': 'bbbb',
'all_router_ids': ['bbbb']})
self.assertRaises(resource.UpdateReplace,
- rsrc.handle_update, {})
+ rsrc.handle_update, {}, {}, {})
self.assertEqual(None, rsrc.delete())
self.m.VerifyAll()
'default_router_id': 'bbbb'})
self.assertRaises(resource.UpdateReplace,
- rsrc.handle_update, {})
+ rsrc.handle_update, {}, {}, {})
self.assertRaises(
exception.InvalidTemplateAttribute,
rsrc.FnGetAtt,
self.assertResourceState(rsrc, 'dddd')
self.assertRaises(resource.UpdateReplace,
- rsrc.handle_update, {})
+ rsrc.handle_update, {}, {}, {})
finally:
stack.delete()
gateway = stack['the_gateway']
self.assertResourceState(gateway, 'the_gateway', {
'external_network_id': 'eeee'})
- self.assertRaises(resource.UpdateReplace, gateway.handle_update, {})
+ self.assertRaises(resource.UpdateReplace, gateway.handle_update,
+ {}, {}, {})
attachment = stack['the_attachment']
self.assertResourceState(attachment, 'the_attachment')
self.assertRaises(resource.UpdateReplace,
- attachment.handle_update, {})
+ attachment.handle_update, {}, {}, {})
stack.delete()
self.m.VerifyAll()
self.assertResourceState(route_table, 'ffff', {})
self.assertRaises(
resource.UpdateReplace,
- route_table.handle_update, {})
+ route_table.handle_update, {}, {}, {})
association = stack['the_association']
self.assertResourceState(association, 'the_association', {})
self.assertRaises(
resource.UpdateReplace,
- association.handle_update, {})
+ association.handle_update, {}, {}, {})
association.delete()
route_table.delete()
self.assertTrue(reason.startswith('WaitConditionTimeout:'))
self.assertRaises(resource.UpdateReplace,
- rsrc.handle_update, {})
+ rsrc.handle_update, {}, {}, {})
self.m.VerifyAll()
@stack_delete_after
self.assertEqual(expected_url, rsrc.FnGetRefId())
self.assertRaises(resource.UpdateReplace,
- rsrc.handle_update, {})
+ rsrc.handle_update, {}, {}, {})
self.m.VerifyAll()
@stack_delete_after