AAP-39220 : Run ccspv2 build_report outside awx #51
+209
−6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue: AAP-39220
Follows #45
Make it possible to run the CCSPv2
build_report
phase outside of the AWX environment.Previously, when importing from
awx
failed, the util would try$AWX_PATH
or/awx_devel
, and fail when that failed.Now, it will warn, but fall back to a
mock_awx
implementation.Adds django-ansible-base as a dependency for the standalone mode,
imports
advisory_lock
fromansible-base
when present (standalone or 2.5), or fromawx
otherwise (2.4).(
Eitherreplaces #47,or replace this bit with #47.)Mocks:
awx.prepare_env
- sets upDJANGO_SETTINGS_MODULE
to point atmock_awx/settings
awx.main.get_awx_version
- hardcoded to24.6.123
for nowawx.main.get_awx_http_client_headers
- license info hardcoded toUNLICENSED
awx.main.datetime_hook
- small wrapper around djangoparse_datetime
, copiedsettings
- empty module)(The idea is to hardcode these for testing, and later replace with a param or an os.environ.get when we need to.)
This does not do anything about anything missing for the gather phase of ccspv2, or any other reports or backends - still unaddressed:
Job
Setting
access_registry
get_license
Testing:
(The
run-ccsp2-build
script is just a convenience wrapper .. maybe we should move it to atools
dir or some such, ideas?)(Possibly there should be an explicit param to allow running with the mocked env if we wanted to preserve 100% error compatibility too - but that means parsing the options before calling into ManagementUtility which deals with options and doesn't really align with the end goal?)
(Mocking awx is to help unblock testing, adding relative import dirs may not work so well for RPM installs.)