Skip to content

Instantly share code, notes, and snippets.

@bcoca
Created February 5, 2020 22:02
Show Gist options
  • Save bcoca/f91264104731a9aa149250d17f895081 to your computer and use it in GitHub Desktop.
Save bcoca/f91264104731a9aa149250d17f895081 to your computer and use it in GitHub Desktop.
diff --git a/lib/ansible/plugins/inventory/nmap.py b/lib/ansible/plugins/inventory/nmap.py
index d2c54fe84e..71fd149988 100644
--- a/lib/ansible/plugins/inventory/nmap.py
+++ b/lib/ansible/plugins/inventory/nmap.py
@@ -113,6 +113,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
cmd.append(self._options['address'])
try:
# execute
+ display.debug("Running %s" % cmd)
p = Popen(cmd, stdout=PIPE, stderr=PIPE)
stdout, stderr = p.communicate()
if p.returncode != 0:
@@ -125,6 +126,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
try:
t_stdout = to_text(stdout, errors='surrogate_or_strict')
+ display.debug("result: \n%s" % t_stdout)
except UnicodeError as e:
raise AnsibleParserError('Invalid (non unicode) input returned: %s' % to_native(e))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment