Bug 2037070 - python3-os-ken sockaddr incompatible with python3
Summary: python3-os-ken sockaddr incompatible with python3
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: python-os-ken
Version: 16.2 (Train)
Hardware: noarch
OS: Linux
low
low
Target Milestone: z2
: 16.2 (Train on RHEL 8.4)
Assignee: Bernard Cafarelli
QA Contact: Toni Freger
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-01-04 20:28 UTC by François Rigault
Modified: 2022-03-23 22:13 UTC (History)
0 users

Fixed In Version: python-os-ken-0.4.1-2.20220110134903.8f7851a.el8ost
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-03-23 22:12:53 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker OSP-12013 0 None None None 2022-01-04 20:33:18 UTC
Red Hat Product Errata RHBA-2022:1001 0 None None None 2022-03-23 22:13:29 UTC

Description François Rigault 2022-01-04 20:28:09 UTC
Description of problem:
os-ken fails with

2021-10-01 09:37:19.153 812 ERROR os_ken.lib.hub [-] hub: uncaught exception: Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/os_ken/lib/hub.py", line 59, in _launch
    return func(*args, **kwargs)
  File "/usr/lib/python3.6/site-packages/os_ken/services/protocols/bgp/peer.py", line 1300, in _connect_loop
    password=password)
  File "/usr/lib/python3.6/site-packages/os_ken/services/protocols/bgp/base.py", line 422, in _connect_tcp
    sockopt.set_tcp_md5sig(sock, peer_addr[0], password)
  File "/usr/lib/python3.6/site-packages/os_ken/lib/sockopt.py", line 71, in set_tcp_md5sig
    impl(s, addr, key)
  File "/usr/lib/python3.6/site-packages/os_ken/lib/sockopt.py", line 38, in _set_tcp_md5sig_linux
    sa = sockaddr.sa_in4(addr)
  File "/usr/lib/python3.6/site-packages/os_ken/lib/sockaddr.py", line 63, in sa_in4
    return _pad_to(hdr + data, _SIN_SIZE)
  File "/usr/lib/python3.6/site-packages/os_ken/lib/sockaddr.py", line 57, in _pad_to
    return data + pad_len * '\0'
TypeError: can't concat str to bytes

Version-Release number of selected component (if applicable):
python3-os-ken-0.4.1-2.20210527163303.8f7851a.el8ost.1.noarch

How reproducible:
using bgpspeaker. Also unit test is provided on 
https://github.com/openstack/os-ken/commit/9a5aa8b7209308a44e463632132c2173216379a6#diff-231a6d938b3f8194f75999207fe3a81fc13c54d45bea6e91795b1b47d9012f80


Steps to Reproduce:
1. see unit test
2.
3.

Actual results:
TypeError: can't concat str to bytes

Expected results:
should work

Additional info:
anyway to get that extra "b" character (the diff is literally a single character!) in python3-os-ken? while not officially supported in OSP16.2 I am experimenting with this, and it is installed in neutron-api  container image.

Comment 1 Bernard Cafarelli 2022-01-05 13:08:17 UTC
A small python3 fix like that can certainly be added

Comment 2 François Rigault 2022-01-10 16:25:53 UTC
Thanks! I should have mentioned the last just above this exception (where the password is logged in clear)

Opening https://storyboard.openstack.org/#!/story/2009779 for that

Comment 3 Bernard Cafarelli 2022-01-12 14:31:04 UTC
(In reply to François Rigault from comment #2)
> Thanks! I should have mentioned the last just above this exception (where
> the password is logged in clear)
> 
> Opening https://storyboard.openstack.org/#!/story/2009779 for that

Thanks for reporting it, I mentioned it in upstream meeting and fix is underway (may be too late for 16.2.2 inclusion though)

Comment 4 François Rigault 2022-01-12 14:37:39 UTC
super! (I actually added a comment on https://review.opendev.org/c/openstack/os-ken/+/824215/1/os_ken/services/protocols/bgp/api/base.py).
this is very low priority.

Regarding this bug, I confirm it is fixed in python-os-ken-0.4.1-2.20220110134903.8f7851a.el8ost.

Comment 12 errata-xmlrpc 2022-03-23 22:12:53 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Release of components for Red Hat OpenStack Platform 16.2.2), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:1001


Note You need to log in before you can comment on or make changes to this bug.