return unicode(self._get_signed_url())
def FnGetRefId(self):
- return unicode(self.name)
+ if self.resource_id is not None:
+ return unicode(self._get_signed_url())
+ else:
+ return unicode(self.name)
def resource_mapping():
stack = parser.Stack.load(self.context, stack=s)
if (stack.action != stack.DELETE
and stack.status == stack.COMPLETE):
- for a in self.rule[self.ACTION_MAP[new_state]]:
- actions.append(stack[a].signal)
+ for refid in self.rule[self.ACTION_MAP[new_state]]:
+ actions.append(stack.resource_by_refid(refid).signal)
else:
logger.warning("Could not process watch state %s for stack" %
new_state)
self._stub_lb_reload(2)
self._stub_meta_expected(now, 'ChangeInCapacity : 1', 2)
self._stub_create(1)
+
+ self.m.StubOutWithMock(asc.ScalingPolicy, 'keystone')
+ asc.ScalingPolicy.keystone().MultipleTimes().AndReturn(
+ self.fc)
+
self.m.ReplayAll()
# Trigger alarm
signal = "dummyfoo"
dummy_action = DummyAction()
- self.m.StubOutWithMock(parser.Stack, '__getitem__')
- parser.Stack.__getitem__(
+ self.m.StubOutWithMock(parser.Stack, 'resource_by_refid')
+ parser.Stack.resource_by_refid(
'WebServerRestartPolicy').AndReturn(dummy_action)
# Replace the real stack threadgroup with a dummy one, so we can
if action_expected:
dummy_action = DummyAction()
- self.m.StubOutWithMock(parser.Stack, '__getitem__')
- parser.Stack.__getitem__(mox.IgnoreArg()
- ).MultipleTimes().AndReturn(dummy_action)
+ self.m.StubOutWithMock(parser.Stack, 'resource_by_refid')
+ parser.Stack.resource_by_refid(mox.IgnoreArg()).\
+ MultipleTimes().AndReturn(dummy_action)
self.m.ReplayAll()