Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set validate_certs to API call to avoid effects from environment vars #1184

Merged
merged 1 commit into from
Apr 17, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion plugins/inventory/foreman.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,11 @@ def _get_json(self, url, ignore_errors=None, params=None):
params['page'] = 1
params['per_page'] = self.get_option('batch_size')
while True:
ret = s.get(url, params=params)
# workaround to address the follwing issues where 'verify' is overridden in Requests:
# - https://github.com/psf/requests/issues/3829
# - https://github.com/psf/requests/issues/5209
ret = s.get(url, params=params, verify=self.get_option('validate_certs'))

if ignore_errors and ret.status_code in ignore_errors:
break
ret.raise_for_status()
Expand Down