Use e.exc_type instead of calling str on exception

This fixes the usage of the oslo RemoteError exception checking
in the Linux Bridge trunk driver to stop calling 'str' on the
exception and just check the 'exc_type' attribute like we do
in the other agent code so it's safe to use with unicode.

Change-Id: I352ed422550343118319f8e83c4979f290f161f0
Closes-Bug: #1697383
(cherry picked from commit cf4e857dd2)
This commit is contained in:
Kevin Benton 2017-06-12 01:36:59 -07:00
parent a08aa3bf2f
commit 5bbb59e3d0
1 changed files with 1 additions and 1 deletions

View File

@ -137,7 +137,7 @@ class _TrunkAPI(object):
except resources_rpc.ResourceNotFound:
return None
except oslo_messaging.RemoteError as e:
if 'CallbackNotFound' not in str(e):
if e.exc_type != 'CallbackNotFound':
raise
LOG.debug("Trunk plugin disabled on server. Assuming port %s is "
"not a trunk.", port_id)