From e02524dd583978f30f4287620b04f88456e27dda Mon Sep 17 00:00:00 2001 From: Matt Williams Date: Mon, 25 Mar 2019 15:29:29 +0000 Subject: [PATCH] Fix for type error introduced by #51034 (#54333) * Fix for type error The empty type here should be a dict, not a list as is has a `get` done on it next. * Return dict directly to avoid failing key lookup --- lib/ansible/plugins/inventory/foreman.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/plugins/inventory/foreman.py b/lib/ansible/plugins/inventory/foreman.py index 874187186ec..996f7d88359 100644 --- a/lib/ansible/plugins/inventory/foreman.py +++ b/lib/ansible/plugins/inventory/foreman.py @@ -175,7 +175,7 @@ class InventoryModule(BaseInventoryPlugin, Cacheable): url = "%s/api/v2/hosts/%s" % (self.foreman_url, hid) ret = self._get_json(url, [404]) if not ret or not isinstance(ret, MutableMapping) or not ret.get('all_parameters', False): - ret = [] + return {} return ret.get('all_parameters') def _get_facts_by_id(self, hid):