Tests require python-oauth2client

Bug #2073242 reported by Adrien Nader
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Confirmed
Undecided
Unassigned
cinder (Ubuntu)
Fix Released
High
Adrien Nader

Bug Description

Cinder has implemented support for both oauth2client and google-auth. However, tests still require oauth2client.

The affected file is cinder/tests/unit/backup/fake_google_client.py . It does the following:

    from oauth2client import client
    [...]
                raise client.Error

I've tried alternatives but a) I'm not familiar enough with the codebases to be entirely confident about them, b) the codepath has not been taken during my tests and I therefore had no way of verifying my changes.

Considering the codepath appears to not be taken during normal operation, a generic Exception seems acceptable to me, at least in the short term. I plan on preparing such a chance soon in order to fix current cinder builds.

Revision history for this message
Adrien Nader (adrien) wrote :

And something related.

The commit visible at https://opendev.org/openstack/cinder/commit/7509ad4fb6f4b6da959868179b98b86f0059979b introduced a change which I think is buggy as it uses 'client.Error' in the codepath where 'client' is None due to oauth2client not being imported.

Revision history for this message
Takashi Kajinami (kajinamit) wrote (last edit ):

oauth2client IS still required because it's in requirements.txt . It's not actually used by logic code if recent google api client is installed but it has been left without any appropriate cleanup.

There is a work to remove usage of oauth2client in master https://review.opendev.org/c/openstack/cinder/+/902120 .
Once that is merged then we can get rid of oauth2client.

Revision history for this message
Adrien Nader (adrien) wrote :

Thanks for your very quick answer. I wasn't aware of that review which looks very interesting.

I should have mentioned I'm looking at this from a Ubuntu packaging perspective. Right now I have an issue because the oauth2client dependency is causing troubles: it uses APIs that have been removed from pyopenssl and I don't want to try to reimplement or work-around anything close to PKCS#12. My goal is therefore to drop the python-oauth2client package from the distribution.

Do you think your patch can be cherry-picked to the Ubuntu package? That would help tremendously.

Adrien Nader (adrien)
Changed in cinder (Ubuntu):
status: New → In Progress
assignee: nobody → Adrien Nader (adrien)
importance: Undecided → High
milestone: none → ubuntu-24.10
Changed in cinder:
status: New → Confirmed
Nick Rosbrook (enr0n)
Changed in cinder (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package cinder - 2:24.0.0-0ubuntu3

---------------
cinder (2:24.0.0-0ubuntu3) oracular; urgency=medium

  * Remove use of python-oauth2client (LP: #2073242):
    - 8fb2b35.diff: remove logic for google-api-python-client < 1.6.0
    - d71530c.diff: remove unused fallback to oauth2client

 -- Adrien Nader <email address hidden> Tue, 23 Jul 2024 15:19:19 +0200

Changed in cinder (Ubuntu):
status: Fix Committed → 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.