diff --git a/plugins/inventory/kubevirt.py b/plugins/inventory/kubevirt.py index 2eb0619..702d3c5 100644 --- a/plugins/inventory/kubevirt.py +++ b/plugins/inventory/kubevirt.py @@ -614,9 +614,15 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable): """ host_vars = self.inventory.get_host(vmi_name).get_vars() strict = self.get_option("strict") - self._set_composite_vars(self.get_option("compose"), host_vars, vmi_name, strict=True) - self._add_host_to_composed_groups(self.get_option("groups"), host_vars, vmi_name, strict=strict) - self._add_host_to_keyed_groups(self.get_option("keyed_groups"), host_vars, vmi_name, strict=strict) + self._set_composite_vars( + self.get_option("compose"), host_vars, vmi_name, strict=True + ) + self._add_host_to_composed_groups( + self.get_option("groups"), host_vars, vmi_name, strict=strict + ) + self._add_host_to_keyed_groups( + self.get_option("keyed_groups"), host_vars, vmi_name, strict=strict + ) def get_ssh_services_for_namespace(self, client: K8SClient, namespace: str) -> Dict: """ diff --git a/tests/unit/utils/ansible_module_mock.py b/tests/unit/utils/ansible_module_mock.py index d489756..9bef3b4 100644 --- a/tests/unit/utils/ansible_module_mock.py +++ b/tests/unit/utils/ansible_module_mock.py @@ -24,11 +24,13 @@ def set_module_args(args): class AnsibleExitJson(Exception): """Exception class to be raised by module.exit_json and caught by the test case""" + pass class AnsibleFailJson(Exception): """Exception class to be raised by module.fail_json and caught by the test case""" + pass