CLI now issues clearer error when 0 hosts selected (#77517)

fixes #77512
pull/77544/head
Brian Coca 2 years ago committed by GitHub
parent 6e5f1d781d
commit 793bb200ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,2 @@
bugfixes:
- cli now emits clearer error on no hosts selected

@ -525,7 +525,7 @@ class CLI(ABC):
hosts = inventory.list_hosts(pattern)
if not hosts and no_hosts is False:
raise AnsibleError("Specified hosts and/or --limit does not match any hosts")
raise AnsibleError("Specified inventory, host pattern and/or --limit leaves us with no hosts to target.")
return hosts

Loading…
Cancel
Save