Merge "Use six.text_type() instead of str() to serialise status"

This commit is contained in:
Jenkins 2017-05-24 05:40:43 +00:00 committed by Gerrit Code Review
commit da24fb687b
3 changed files with 6 additions and 6 deletions

View File

@ -1849,7 +1849,7 @@ class Resource(status.ResourceStatus):
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

@ -259,7 +259,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)
@ -340,7 +340,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

@ -611,7 +611,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
@ -960,7 +960,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
@ -990,7 +990,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)