mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +00:00
improved nmap fix, updated as per fb (#53280)
(cherry picked from commit 5280ae917c4a49df1bb4ff354885bc046e7ee397)
This commit is contained in:
@@ -126,8 +126,13 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
|
|||||||
host = None
|
host = None
|
||||||
ip = None
|
ip = None
|
||||||
ports = []
|
ports = []
|
||||||
for line in stdout.splitlines():
|
|
||||||
line = to_text(line)
|
try:
|
||||||
|
t_stdout = to_text(stdout, errors='surrogate_or_strict')
|
||||||
|
except UnicodeError as e:
|
||||||
|
raise AnsibleParserError('Invalid (non unicode) input returned: %s' % to_native(e))
|
||||||
|
|
||||||
|
for line in t_stdout.splitlines():
|
||||||
hits = self.find_host.match(line)
|
hits = self.find_host.match(line)
|
||||||
if hits:
|
if hits:
|
||||||
if host is not None:
|
if host is not None:
|
||||||
|
|||||||
Reference in New Issue
Block a user