Skip to content

Commit

Permalink
redhat_manifest: drop Ansible pre 2.9 special casing
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeni committed Nov 7, 2024
1 parent 5120400 commit 945a5e7
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions plugins/modules/redhat_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,16 +154,7 @@ def fetch_portal(module, path, method, data=None, accept_header='application/jso
fetch_kwargs = {'timeout': 30}
if os.path.exists(REDHAT_UEP):
fetch_kwargs['ca_path'] = REDHAT_UEP
try:
resp, info = fetch_url(module, url, data, headers, method, **fetch_kwargs)
except TypeError:
# ca_path was added in Ansible 2.9 and backported to 2.8 in 2.8.6
# older Ansible releases don't support that and we have to omit the CA cert here
if module.params['validate_certs']:
module.warn("Your Ansible version does not support providing custom CA certificates for HTTP requests. "
"Talking to the Red Hat portal might fail without validate_certs=False. Please update.")
del fetch_kwargs['ca_path']
resp, info = fetch_url(module, url, data, headers, method, **fetch_kwargs)
resp, info = fetch_url(module, url, data, headers, method, **fetch_kwargs)
if resp is None or info["status"] >= 400:
try:
error = json.loads(info['body'])['displayMessage']
Expand Down

0 comments on commit 945a5e7

Please sign in to comment.