mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
added python3 support to nginx_status_facts module (#55428)
This commit is contained in:
parent
9421a7fddf
commit
5dcc178679
1 changed files with 2 additions and 1 deletions
|
@ -96,6 +96,7 @@ nginx_status_facts.data:
|
||||||
import re
|
import re
|
||||||
from ansible.module_utils.basic import AnsibleModule
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
from ansible.module_utils.urls import fetch_url
|
from ansible.module_utils.urls import fetch_url
|
||||||
|
from ansible.module_utils._text import to_text
|
||||||
|
|
||||||
|
|
||||||
class NginxStatusFacts(object):
|
class NginxStatusFacts(object):
|
||||||
|
@ -121,7 +122,7 @@ class NginxStatusFacts(object):
|
||||||
if not response:
|
if not response:
|
||||||
module.fail_json(msg="No valid or no response from url %s within %s seconds (timeout)" % (self.url, self.timeout))
|
module.fail_json(msg="No valid or no response from url %s within %s seconds (timeout)" % (self.url, self.timeout))
|
||||||
|
|
||||||
data = response.read()
|
data = to_text(response.read(), errors='surrogate_or_strict')
|
||||||
if not data:
|
if not data:
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue