Merge "Use new log style when LOG.error"

This commit is contained in:
Jenkins 2016-01-05 09:04:45 +00:00 committed by Gerrit Code Review
commit f5057aa30b
3 changed files with 5 additions and 3 deletions

View File

@ -1091,7 +1091,7 @@ def servers_update_addresses(request, servers, all_tenants=False):
ports_floating_ips,
network_names)
except Exception as e:
LOG.error(e)
LOG.error(six.text_type(e))
else:
server.addresses = addresses

View File

@ -21,6 +21,7 @@ import logging
import operator
from oslo_utils import units
import six
from django.template.defaultfilters import filesizeformat # noqa
from django.utils.text import normalize_newlines # noqa
@ -688,7 +689,8 @@ class CustomizeAction(workflows.Action):
except Exception as e:
msg = _('There was a problem parsing the'
' %(prefix)s: %(error)s')
msg = msg % {'prefix': prefix, 'error': e}
msg = msg % {'prefix': prefix,
'error': six.text_type(e)}
raise forms.ValidationError(msg)
return script
else:

View File

@ -191,7 +191,7 @@ class TemplateForm(forms.SelfHandlingForm):
except Exception as e:
msg = _('There was a problem parsing the'
' %(prefix)s: %(error)s')
msg = msg % {'prefix': prefix, 'error': e}
msg = msg % {'prefix': prefix, 'error': six.text_type(e)}
raise forms.ValidationError(msg)
cleaned[data_str] = tpl