Merge "replaced e.message with unicode(e)"
This commit is contained in:
commit
d713c46f10
@ -63,7 +63,7 @@ class SecurityGroupAPI(security_group_base.SecurityGroupBase):
|
||||
# quota
|
||||
raise exc.HTTPBadRequest()
|
||||
elif e.status_code == 409:
|
||||
self.raise_over_quota(e.message)
|
||||
self.raise_over_quota(unicode(e))
|
||||
raise exc_info[0], exc_info[1], exc_info[2]
|
||||
return self._convert_to_nova_security_group_format(security_group)
|
||||
|
||||
@ -131,7 +131,7 @@ class SecurityGroupAPI(security_group_base.SecurityGroupBase):
|
||||
exc_info = sys.exc_info()
|
||||
if e.status_code == 404:
|
||||
LOG.debug(_("Neutron security group %s not found"), name)
|
||||
self.raise_not_found(e.message)
|
||||
self.raise_not_found(unicode(e))
|
||||
else:
|
||||
LOG.error(_("Neutron Error: %s"), e)
|
||||
raise exc_info[0], exc_info[1], exc_info[2]
|
||||
@ -176,9 +176,9 @@ class SecurityGroupAPI(security_group_base.SecurityGroupBase):
|
||||
except n_exc.NeutronClientException as e:
|
||||
exc_info = sys.exc_info()
|
||||
if e.status_code == 404:
|
||||
self.raise_not_found(e.message)
|
||||
self.raise_not_found(unicode(e))
|
||||
elif e.status_code == 409:
|
||||
self.raise_invalid_property(e.message)
|
||||
self.raise_invalid_property(unicode(e))
|
||||
else:
|
||||
LOG.error(_("Neutron Error: %s"), e)
|
||||
raise exc_info[0], exc_info[1], exc_info[2]
|
||||
@ -202,11 +202,11 @@ class SecurityGroupAPI(security_group_base.SecurityGroupBase):
|
||||
if e.status_code == 404:
|
||||
LOG.exception(_("Neutron Error getting security group %s"),
|
||||
name)
|
||||
self.raise_not_found(e.message)
|
||||
self.raise_not_found(unicode(e))
|
||||
elif e.status_code == 409:
|
||||
LOG.exception(_("Neutron Error adding rules to security "
|
||||
"group %s"), name)
|
||||
self.raise_over_quota(e.message)
|
||||
self.raise_over_quota(unicode(e))
|
||||
else:
|
||||
LOG.exception(_("Neutron Error:"))
|
||||
raise exc_info[0], exc_info[1], exc_info[2]
|
||||
@ -273,7 +273,7 @@ class SecurityGroupAPI(security_group_base.SecurityGroupBase):
|
||||
exc_info = sys.exc_info()
|
||||
if e.status_code == 404:
|
||||
LOG.debug(_("Neutron security group rule %s not found"), id)
|
||||
self.raise_not_found(e.message)
|
||||
self.raise_not_found(unicode(e))
|
||||
else:
|
||||
LOG.error(_("Neutron Error: %s"), e)
|
||||
raise exc_info[0], exc_info[1], exc_info[2]
|
||||
|
@ -3966,7 +3966,7 @@ class LibvirtDriver(driver.ComputeDriver):
|
||||
ret = self._conn.compareCPU(cpu.to_xml(), 0)
|
||||
except libvirt.libvirtError as e:
|
||||
with excutils.save_and_reraise_exception():
|
||||
ret = e.message
|
||||
ret = unicode(e)
|
||||
LOG.error(m, {'ret': ret, 'u': u})
|
||||
|
||||
if ret <= 0:
|
||||
|
@ -306,7 +306,7 @@ class API(base.Base):
|
||||
item = cinderclient(context).volumes.create(size, **kwargs)
|
||||
return _untranslate_volume_summary_view(context, item)
|
||||
except cinder_exception.BadRequest as e:
|
||||
raise exception.InvalidInput(reason=e.message)
|
||||
raise exception.InvalidInput(reason=unicode(e))
|
||||
|
||||
@translate_volume_exception
|
||||
def delete(self, context, volume_id):
|
||||
|
Loading…
Reference in New Issue
Block a user