Guest User

Untitled

a guest
Feb 26th, 2020
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. diff --git a/neutron/privileged/agent/linux/ip_lib.py b/neutron/privileged/agent/linux/ip_lib.py
  2. index 6e8d98c824..4993fe4d29 100644
  3. --- a/neutron/privileged/agent/linux/ip_lib.py
  4. +++ b/neutron/privileged/agent/linux/ip_lib.py
  5. @@ -522,13 +522,14 @@ def make_serializable(value):
  6. def _ensure_string(value):
  7. # NOTE(ralonsoh): once PY2 is deprecated, the str() conversion will be
  8. # no needed and six.binary_type --> bytes.
  9. + return value.decode() if isinstance(value, bytes) else value
  10. return (str(value.decode('utf-8'))
  11. if isinstance(value, six.binary_type) else value)
  12.  
  13. if isinstance(value, list):
  14. return [make_serializable(item) for item in value]
  15. elif isinstance(value, netlink.nla_slot):
  16. - return [value[0], make_serializable(value[1])]
  17. + return [value[0].decode() if isinstance(value[0], bytes) else value[0], make_serializable(value[1])]
  18. elif isinstance(value, netlink.nla_base) and six.PY3:
  19. return make_serializable(value.dump())
  20. elif isinstance(value, dict):
Advertisement
Add Comment
Please, Sign In to add comment