Don't error when ensuring a hosts list with a non-existant inventory group (default to []).
@@ -36,9 +36,9 @@ def ensure_host_list(hosts, inventory):
if hosts is None:
return hosts
- # If passed a string, treat as group name and get hosts from inventory
+ # If passed a string, treat as group name and get any hosts from inventory
if isinstance(hosts, six.string_types):
- return inventory.get_group(hosts)
+ return inventory.get_group(hosts, [])
if not isinstance(hosts, (list, tuple)):
return [hosts]
