netfilter_log: Correctly decode binary type prefix
Under Python 3, firewall log prefixes are incorrectly decoded
resulting in a mismatch between the stringy-fied 'prefix' value
and the information available in the prefixes data.
Use oslo.utils safe_decode function to ensure that data is
correctly decoded.
Change-Id: I9742207e98c07f0a4632631631288d9ada8cf8c7
Closes-Bug: 1832210
(cherry picked from commit 652f532d84
)
This commit is contained in:
parent
55a5a41b4c
commit
ea7590e4e1
|
@ -24,6 +24,7 @@ from eventlet.green import zmq
|
|||
from neutron_lib.utils import runtime
|
||||
from oslo_log import log as logging
|
||||
from oslo_serialization import jsonutils
|
||||
from oslo_utils import encodeutils
|
||||
from oslo_utils import excutils
|
||||
from ryu.lib import addrconv
|
||||
from ryu.lib.packet import arp
|
||||
|
@ -166,7 +167,8 @@ def decode(nfa):
|
|||
else:
|
||||
msg += "Does not support hw_proto: " + str(hw_proto)
|
||||
|
||||
return {'prefix': str(prefix), 'msg': str(msg)}
|
||||
return {'prefix': encodeutils.safe_decode(prefix),
|
||||
'msg': encodeutils.safe_decode(msg)}
|
||||
|
||||
|
||||
class NFLogWrapper(object):
|
||||
|
|
Loading…
Reference in New Issue