awx icon indicating copy to clipboard operation
awx copied to clipboard

Fix Delinea imports and import test

Open thedoubl3j opened this issue 2 years ago • 3 comments

Please confirm the following

  • [X] I agree to follow this project's code of conduct.
  • [X] I have checked the current issues for duplicates.
  • [X] I understand that AWX is open source software provided for free and that I might not receive a timely response.
  • [X] I am NOT reporting a (potential) security vulnerability. (These should be emailed to [email protected] instead.)

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

  • [ ] UI
  • [ ] UI (tech preview)
  • [X] API
  • [ ] Docs
  • [ ] Collection
  • [ ] CLI
  • [ ] Other

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

thedoubl3j avatar Dec 05 '23 21:12 thedoubl3j

Working on this issue.

baseely avatar Jan 02 '24 23:01 baseely

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.

dmzoneill avatar Jan 25 '24 14:01 dmzoneill

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.

thedoubl3j avatar Jan 25 '24 14:01 thedoubl3j