Pyroute2 can return dictionary keys in bytes instead of strings

Bug #1846360 reported by Rodolfo Alonso
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
High
Rodolfo Alonso

Bug Description

Pyroute2 can return dictionary keys in bytes instead of strings. This can cause the following error: http://paste.openstack.org/show/780851/

Pyroute2 structure returned (example):
http://paste.openstack.org/show/780852/

Changed in neutron:
assignee: nobody → Rodolfo Alonso (rodolfo-alonso-hernandez)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.opendev.org/686206

Changed in neutron:
status: New → In Progress
description: updated
Changed in neutron:
importance: Undecided → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.opendev.org/686206
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=592b44629905d68b39ec92604b882627f4844908
Submitter: Zuul
Branch: master

commit 592b44629905d68b39ec92604b882627f4844908
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Wed Oct 2 16:14:05 2019 +0000

    Convert Pyroute2 byte results to strings

    Pyroute2 can return information structures with values as bytes
    instead of strings. In order to unify the output, those byte
    parameters will be converted to string. This is needed in case of
    having dictionaries with keys as bytes instead of strings.

    Change-Id: Ic665b2c5e28d06e21190f06d9f3f8e8f8c3c792d
    Closes-Bug: #1846360

Changed in neutron:
status: In Progress → Fix Released
tags: added: neutron-proactive-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/train)

Fix proposed to branch: stable/train
Review: https://review.opendev.org/696523

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/stein)

Fix proposed to branch: stable/stein
Review: https://review.opendev.org/696527

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/train)

Reviewed: https://review.opendev.org/696523
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=4f5eeba32a70ecb963776aebbc2ff0949d1154f1
Submitter: Zuul
Branch: stable/train

commit 4f5eeba32a70ecb963776aebbc2ff0949d1154f1
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Wed Oct 2 16:14:05 2019 +0000

    Convert Pyroute2 byte results to strings

    Pyroute2 can return information structures with values as bytes
    instead of strings. In order to unify the output, those byte
    parameters will be converted to string. This is needed in case of
    having dictionaries with keys as bytes instead of strings.

    Change-Id: Ic665b2c5e28d06e21190f06d9f3f8e8f8c3c792d
    Closes-Bug: #1846360
    (cherry picked from commit 592b44629905d68b39ec92604b882627f4844908)

tags: added: in-stable-train
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/stein)

Reviewed: https://review.opendev.org/696527
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=57edfee5da12ed32f625de6120c344ce69b46619
Submitter: Zuul
Branch: stable/stein

commit 57edfee5da12ed32f625de6120c344ce69b46619
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Wed Oct 2 16:14:05 2019 +0000

    Convert Pyroute2 byte results to strings

    Pyroute2 can return information structures with values as bytes
    instead of strings. In order to unify the output, those byte
    parameters will be converted to string. This is needed in case of
    having dictionaries with keys as bytes instead of strings.

    Change-Id: Ic665b2c5e28d06e21190f06d9f3f8e8f8c3c792d
    Closes-Bug: #1846360
    (cherry picked from commit 592b44629905d68b39ec92604b882627f4844908)

tags: added: in-stable-stein
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 14.0.4

This issue was fixed in the openstack/neutron 14.0.4 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 15.0.1

This issue was fixed in the openstack/neutron 15.0.1 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 16.0.0.0b1

This issue was fixed in the openstack/neutron 16.0.0.0b1 development milestone.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to neutron (master)

Related fix proposed to branch: master
Review: https://review.opendev.org/710082

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to neutron (master)

Reviewed: https://review.opendev.org/710082
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=43e150e690538a509be8177353269787790ee143
Submitter: Zuul
Branch: master

commit 43e150e690538a509be8177353269787790ee143
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Wed Feb 26 16:46:15 2020 +0000

    Ensure netlink.nla_slot tuple key is a string

    Ensure Pyroute2 netlink.nla_slot first element ("name"), is properly
    converted to a string value. E.g.:
      In: (b'IFA_ADDRESS', '192.168.30.20')
      Out: ('IFA_ADDRESS', '192.168.30.20')

    Python2 compatibility checks are removed from ip_lib.make_serializable.

    Change-Id: I87efe6cf8734bae6523106944e99fbd7db9ef4d5
    Related-Bug: #1846360

tags: removed: neutron-proactive-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to neutron (stable/train)

Related fix proposed to branch: stable/train
Review: https://review.opendev.org/718364

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to neutron (stable/stein)

Related fix proposed to branch: stable/stein
Review: https://review.opendev.org/718366

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to neutron (stable/stein)

Reviewed: https://review.opendev.org/718366
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=551464dd77895cd6068d2947a31e3716201757a6
Submitter: Zuul
Branch: stable/stein

commit 551464dd77895cd6068d2947a31e3716201757a6
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Wed Feb 26 16:46:15 2020 +0000

    Ensure netlink.nla_slot tuple key is a string

    Ensure Pyroute2 netlink.nla_slot first element ("name"), is properly
    converted to a string value. E.g.:
      In: (b'IFA_ADDRESS', '192.168.30.20')
      Out: ('IFA_ADDRESS', '192.168.30.20')

    Conflicts:
          neutron/privileged/agent/linux/ip_lib.py

    Change-Id: I87efe6cf8734bae6523106944e99fbd7db9ef4d5
    Related-Bug: #1846360
    (cherry picked from commit 43e150e690538a509be8177353269787790ee143)
    (cherry picked from commit c36867487454b4e01bece0a2769586884dbf379d)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to neutron (stable/train)

Reviewed: https://review.opendev.org/718364
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=c36867487454b4e01bece0a2769586884dbf379d
Submitter: Zuul
Branch: stable/train

commit c36867487454b4e01bece0a2769586884dbf379d
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Wed Feb 26 16:46:15 2020 +0000

    Ensure netlink.nla_slot tuple key is a string

    Ensure Pyroute2 netlink.nla_slot first element ("name"), is properly
    converted to a string value. E.g.:
      In: (b'IFA_ADDRESS', '192.168.30.20')
      Out: ('IFA_ADDRESS', '192.168.30.20')

    Conflicts:
          neutron/privileged/agent/linux/ip_lib.py

    Change-Id: I87efe6cf8734bae6523106944e99fbd7db9ef4d5
    Related-Bug: #1846360
    (cherry picked from commit 43e150e690538a509be8177353269787790ee143)

tags: added: neutron-proactive-backport-potential
Revision history for this message
Rodolfo Alonso (rodolfo-alonso-hernandez) wrote :

Hello:

The patch introducing the method "_make_serializable" [1] is in master (U), T and S. The patches fixing the issue described in this bug are in those branches too.

We can safely remove the backport tag.

Regards.

[1]https://review.opendev.org/#/c/618273/
[2]I87efe6cf8734bae6523106944e99fbd7db9ef4d5
[3]Ic665b2c5e28d06e21190f06d9f3f8e8f8c3c792d

tags: removed: neutron-proactive-backport-potential
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.