Don't try to store i18n messages
Serialize i18n messages before they reach the sql layer, to prevent an issue with python3. This also fixes an issue with map behavior. Change-Id: Ib934f5ac27cc1983a12c73f38927a116d50a5e6e
This commit is contained in:
parent
742c0db1de
commit
2b69e0e245
|
@ -1736,7 +1736,7 @@ class Resource(object):
|
|||
try:
|
||||
rs = {'action': self.action,
|
||||
'status': self.status,
|
||||
'status_reason': self.status_reason,
|
||||
'status_reason': str(self.status_reason),
|
||||
'stack_id': self.stack.id,
|
||||
'physical_resource_id': self.resource_id,
|
||||
'name': self.name,
|
||||
|
@ -1777,7 +1777,7 @@ class Resource(object):
|
|||
data = {
|
||||
'action': self.action,
|
||||
'status': self.status,
|
||||
'status_reason': reason,
|
||||
'status_reason': str(reason),
|
||||
'stack_id': self.stack.id,
|
||||
'updated_at': self.updated_time,
|
||||
'needed_by': self.needed_by,
|
||||
|
|
|
@ -1041,11 +1041,13 @@ class EngineService(service.ServiceBase):
|
|||
return api.format_stack_resource(current.resources.get(k))
|
||||
|
||||
return {
|
||||
'unchanged': map(fmt_updated_res, act.get('unchanged', [])),
|
||||
'updated': map(fmt_current_res, act.get('updated', [])),
|
||||
'replaced': map(fmt_updated_res, act.get('replaced', [])),
|
||||
'added': map(fmt_updated_res, act.get('added', [])),
|
||||
'deleted': map(fmt_current_res, act.get('deleted', [])),
|
||||
'unchanged': list(
|
||||
map(fmt_updated_res, act.get('unchanged', []))),
|
||||
'updated': list(map(fmt_current_res, act.get('updated', []))),
|
||||
'replaced': list(
|
||||
map(fmt_updated_res, act.get('replaced', []))),
|
||||
'added': list(map(fmt_updated_res, act.get('added', []))),
|
||||
'deleted': list(map(fmt_current_res, act.get('deleted', []))),
|
||||
}
|
||||
|
||||
updated_stack.id = current_stack.id
|
||||
|
|
|
@ -256,7 +256,7 @@ class SoftwareConfigService(object):
|
|||
'stack_user_project_id': stack_user_project_id,
|
||||
'action': action,
|
||||
'status': status,
|
||||
'status_reason': status_reason})
|
||||
'status_reason': str(status_reason)})
|
||||
self._push_metadata_software_deployments(
|
||||
cnxt, server_id, stack_user_project_id)
|
||||
return api.format_software_deployment(sd)
|
||||
|
@ -337,7 +337,7 @@ class SoftwareConfigService(object):
|
|||
if status:
|
||||
update_data['status'] = status
|
||||
if status_reason:
|
||||
update_data['status_reason'] = status_reason
|
||||
update_data['status_reason'] = str(status_reason)
|
||||
if updated_at:
|
||||
update_data['updated_at'] = timeutils.normalize_time(
|
||||
timeutils.parse_isotime(updated_at))
|
||||
|
|
|
@ -607,7 +607,7 @@ class Stack(collections.Mapping):
|
|||
stack.update({
|
||||
'action': self.action,
|
||||
'status': self.status,
|
||||
'status_reason': self.status_reason})
|
||||
'status_reason': str(self.status_reason)})
|
||||
|
||||
if only_db:
|
||||
stack['parent_resource_name'] = self.parent_resource_name
|
||||
|
@ -951,7 +951,7 @@ class Stack(collections.Mapping):
|
|||
if stack is not None:
|
||||
values = {'action': self.action,
|
||||
'status': self.status,
|
||||
'status_reason': self.status_reason}
|
||||
'status_reason': str(self.status_reason)}
|
||||
self._send_notification_and_add_event()
|
||||
if self.convergence:
|
||||
# do things differently for convergence
|
||||
|
@ -983,7 +983,7 @@ class Stack(collections.Mapping):
|
|||
if stack is not None:
|
||||
values = {'action': self.action,
|
||||
'status': self.status,
|
||||
'status_reason': self.status_reason}
|
||||
'status_reason': str(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