Fix Delinea imports and import test
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
Working on this issue.
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.
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.