Use six.text_type() instead of str() to serialise status
Change-Id: Icdcacef27595728b94df7aaf9819f234ad6f2dfa Closes-Bug: #1692693
This commit is contained in:
parent
46e42c5184
commit
007d4cbfdd
@ -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,
|
||||
|
@ -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))
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user