Fix error message for non-str hosts in yaml inventory (#77544)

pull/77569/head
Sloane Hertel 2 years ago committed by GitHub
parent abdd237de7
commit 9280396e19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -174,6 +174,10 @@ class InventoryModule(BaseFileInventoryPlugin):
'''
Each host key can be a pattern, try to process it and add variables as needed
'''
(hostnames, port) = self._expand_hostpattern(host_pattern)
try:
(hostnames, port) = self._expand_hostpattern(host_pattern)
except TypeError:
raise AnsibleParserError(
f"Host pattern {host_pattern} must be a string. Enclose integers/floats in quotation marks."
)
return hostnames, port

Loading…
Cancel
Save