new_state)
actioned = True
else:
- s = db_api.stack_get_by_name(self.context, self.stack_name)
+ # FIXME : hack workaround for new stack_get_by_name tenant
+ # scoping, this is the simplest possible solution to the
+ # HA/Autoscaling regression described in bug/1078779
+ # Further work in-progress here (shardy) as this
+ # breaks when stack_name is not unique accross tenants
+ sl = [x for x in
+ db_api.stack_get_all(self.context)
+ if x.name == self.stack_name]
+ s = None
+ if len(sl) == 1:
+ s = sl[0]
+ elif len(sl) > 1:
+ logger.error("stack %s name not unique, " % self.stack_name
+ + "cannot action watch rule")
+ else:
+ logger.error("stack %s name could not be found, " %
+ self.stack_name + "cannot action watch rule")
+
if s and s.status in (parser.Stack.CREATE_COMPLETE,
parser.Stack.UPDATE_COMPLETE):
user_creds = db_api.user_creds_get(s.user_creds_id)