Debian: Python 3 incompatibility related error with python3-oidcauthtools package

Bug #1978963 reported by Andy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Fix Released
Medium
Andy

Bug Description

Brief Description
-----------------
With oidc-auth-apps applied and configured, oidc-auth cli failed with error and trace back.

Severity
--------
Major: oidc-auth cli fails, can't get token to access k8s with token.

Steps to Reproduce
------------------
$ oidc-auth -c 192.168.206.2 -u <username> -p <password>
Traceback (most recent call last):
  File "/usr/bin/oidc-auth", line 10, in <module>
    sys.exit(main())
  File "/usr/lib/python3/dist-packages/oidcauthtools/oidc_auth.py", line 121, in main
    for item in stringResponse.split("\n"):
TypeError: a bytes-like object is required, not 'str'

Expected Behavior
------------------
Command should work fine with python3 in debian

Actual Behavior
----------------
TypeError: a bytes-like object is required, not 'str'

Reproducibility
---------------
100% reproducible

System Configuration
--------------------
Any

Branch/Pull Time/Commit
-----------------------
STX master latest

Last Pass
---------
Unknown

Timestamp/Logs
--------------
See Steps to Reproduce.

Test Activity
-------------
Regression Testing

Workaround
----------
NA

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to oidc-auth-armada-app (master)
Changed in starlingx:
status: New → In Progress
Ghada Khalil (gkhalil)
Changed in starlingx:
assignee: nobody → Andy (andy.wrs)
importance: Undecided → Medium
tags: added: stx.7.0 stx.apps stx.debian
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to oidc-auth-armada-app (master)

Reviewed: https://review.opendev.org/c/starlingx/oidc-auth-armada-app/+/846174
Committed: https://opendev.org/starlingx/oidc-auth-armada-app/commit/ffa3a8f63728236e3f27320adc8b3b70358d2fe5
Submitter: "Zuul (22348)"
Branch: master

commit ffa3a8f63728236e3f27320adc8b3b70358d2fe5
Author: Andy Ning <email address hidden>
Date: Thu Jun 16 09:31:30 2022 -0400

    Fix oidc-auth cli for python3

    The response to oidc token request is bytes type. This is
    fine with python2 as there is no distinguish between bytes
    and string. But in python3, bytes and string are different,
    causing some string operations (such as split(response, "\n"))
    to fail. This is fixed by converting the bytes into string if
    the script is run in python3.

    Test Plan for Debian and CentOS:
    PASS: python3-oidcauthtools package build.
    PASS: With oidc-auth-apps applied and configured, run oidc-auth
          cli to get a token.

    Closes-Bug: 1978963
    Signed-off-by: Andy Ning <email address hidden>
    Change-Id: I09e2ddab1b0ab44b0dd5aefebbe25624b3b67300

Changed in starlingx:
status: In Progress → Fix Released
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.