ansible / awx

AWX provides a web-based user interface, REST API, and task engine built on top of Ansible. It is one of the upstream projects for Red Hat Ansible Automation Platform.
Other
14k stars 3.42k forks source link

Fix Delinea imports and import test #14703

Open thedoubl3j opened 10 months ago

thedoubl3j commented 10 months ago

Please confirm the following

Bug Summary

DomainPasswordGrantAuthorizer is unused in awx/main/credential_plugins/tss.py. Flake8 will most likely catch this on the next run so just want to get ahead of this.

awx/main/tests/functional/test_credential_plugins.py will also need to be adjusted for its removal.

AWX version

devel

Select the relevant components

Installation method

N/A

Modifications

no

Ansible version

n/a

Operating system

n/a

Web browser

No response

Steps to reproduce

Run flake8 and functional tests locally, they will fail with unused imports.

Expected results

Tests pass without issue.

Actual results

ImportError: cannot import name 'DomainPasswordGrantAuthorizer' from 'awx.main.credential_plugins.tss' (/awx_devel/awx/main/credential_plugins/tss.py) or an unused import: DomainPasswordGrantAuthorizer is imported but not used will show up

Additional information

We can remove the try except block now as well if we want as the requirements file has been updated. I will pick this up if no one from the community wants to take it up

baseely commented 9 months ago

Working on this issue.

dmzoneill commented 8 months ago

Can you provide more details here? whilst the direction is to remote the try/catch and the associated DomainPasswordGrantAuthorizer, there is further code in the file that was redundancies on these includes.

thedoubl3j commented 8 months ago

while the context for this was very much more on the "getting ahead" of flake8 and getting rid of things that are unused, if you are finding more redundancies and you are able to confirm it doesn't affect functionality, I see no reason to not include them in this fix. I am working on attempting to get in contact with our Delinea counterparts to have them review the existing plugins (and also look at #14745)a so if we have another PR up for them to review, that is always good.