mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-04 07:24:00 -07:00
[PR #6114/6cf67448 backport][stable-6] memset*.py: Fixed URLError handling (#6157)
memset*.py: Fixed URLError handling (#6114)
* memset.py: Added URLError exception and stderr to Response() object
* memset_*.py: Check response.status_code and response.stderr
* Added changelog fragment
* memset.py: Fixed pep8
* Renamed changelog fragment with .yml file extension
(cherry picked from commit 6cf674485f
)
Co-authored-by: Daniel Patrick <dani.p1991@gmail.com>
This commit is contained in:
parent
47514e1401
commit
36eff2fd99
8 changed files with 30 additions and 5 deletions
|
@ -134,7 +134,10 @@ def get_facts(args=None):
|
|||
# informed of the reason.
|
||||
retvals['failed'] = has_failed
|
||||
retvals['msg'] = msg
|
||||
retvals['stderr'] = "API returned an error: {0}" . format(response.status_code)
|
||||
if response.status_code is not None:
|
||||
retvals['stderr'] = "API returned an error: {0}" . format(response.status_code)
|
||||
else:
|
||||
retvals['stderr'] = "{0}" . format(response.stderr)
|
||||
return retvals
|
||||
|
||||
# we don't want to return the same thing twice
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue