Reduce size of stack_identity in heat notifications

Reduce "stack_identity" field in heat notifications because
it is too long for other consumers (at least for ceilometer).
So UUID of the stack will be used as stack identity instead
of arn in heat notifications.
NOTE: stack statistics for existing stacks will not be 
considered in ceilometer because we changed stack identity
and ceilometer recognize stacks with UUIDs as 
"new" resources. I consulted with gordonchung about this 
and it seems that it is not critical for ceilometer.

Closes-bug: #1468916
Change-Id: I74d192b8076c344dceab5754681c129a9e0fcd22
This commit is contained in:
kairat_kushaev 2015-06-26 18:49:58 +03:00 committed by Kairat Kushaev
parent 0976466463
commit d8c41029b4
2 changed files with 4 additions and 4 deletions

View File

@ -266,7 +266,7 @@ def format_notification_body(stack):
result = {
rpc_api.NOTIFY_TENANT_ID: stack.context.tenant_id,
rpc_api.NOTIFY_USER_ID: stack.context.user,
rpc_api.NOTIFY_STACK_ID: stack.identifier().arn(),
rpc_api.NOTIFY_STACK_ID: stack.id,
rpc_api.NOTIFY_STACK_NAME: stack.name,
rpc_api.NOTIFY_STATE: state,
rpc_api.NOTIFY_STATE_REASON: stack.status_reason,

View File

@ -35,7 +35,7 @@ class StackTest(common.HeatTestCase):
st.status_reason = 'this is why'
st.created_time = created_time
st.context = self.ctx
st.identifier.return_value.arn.return_value = 'hay-are-en'
st.id = 'hay-are-en'
notify = self.patchobject(notification, 'notify')
@ -66,7 +66,7 @@ class AutoScaleTest(common.HeatTestCase):
st.status_reason = 'this is why'
st.created_time = created_time
st.context = self.ctx
st.identifier.return_value.arn.return_value = 'hay-are-en'
st.id = 'hay-are-en'
notify = self.patchobject(notification, 'notify')
@ -98,7 +98,7 @@ class AutoScaleTest(common.HeatTestCase):
st.status_reason = 'this is why'
st.created_time = created_time
st.context = self.ctx
st.identifier.return_value.arn.return_value = 'hay-are-en'
st.id = 'hay-are-en'
notify = self.patchobject(notification, 'notify')