Merge "Use six.text_type() instead of str() to serialise status" into stable/ocata

This commit is contained in:
Jenkins 2017-06-01 02:41:20 +00:00 committed by Gerrit Code Review
commit b54e200d19
3 changed files with 6 additions and 6 deletions

View File

@ -1745,7 +1745,7 @@ class Resource(object):
rs = {'action': self.action,
'status': self.status,
'status_reason': str(self.status_reason),
'status_reason': six.text_type(self.status_reason),
'stack_id': self.stack.id,
'physical_resource_id': self.resource_id,
'name': self.name,

View File

@ -257,7 +257,7 @@ class SoftwareConfigService(object):
'stack_user_project_id': stack_user_project_id,
'action': action,
'status': status,
'status_reason': str(status_reason)})
'status_reason': six.text_type(status_reason)})
self._push_metadata_software_deployments(
cnxt, server_id, stack_user_project_id)
return api.format_software_deployment(sd)
@ -338,7 +338,7 @@ class SoftwareConfigService(object):
if status:
update_data['status'] = status
if status_reason:
update_data['status_reason'] = str(status_reason)
update_data['status_reason'] = six.text_type(status_reason)
if updated_at:
update_data['updated_at'] = timeutils.normalize_time(
timeutils.parse_isotime(updated_at))

View File

@ -606,7 +606,7 @@ class Stack(collections.Mapping):
stack.update({
'action': self.action,
'status': self.status,
'status_reason': str(self.status_reason)})
'status_reason': six.text_type(self.status_reason)})
if only_db:
stack['parent_resource_name'] = self.parent_resource_name
@ -949,7 +949,7 @@ class Stack(collections.Mapping):
if stack is not None:
values = {'action': self.action,
'status': self.status,
'status_reason': str(self.status_reason)}
'status_reason': six.text_type(self.status_reason)}
self._send_notification_and_add_event()
if self.convergence:
# do things differently for convergence
@ -981,7 +981,7 @@ class Stack(collections.Mapping):
if stack is not None:
values = {'action': self.action,
'status': self.status,
'status_reason': str(self.status_reason)}
'status_reason': six.text_type(self.status_reason)}
self._send_notification_and_add_event()
stack.persist_state_and_release_lock(self.context, self.id,
engine_id, values)