mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 21:32:49 +00:00
Make ansible_selinux facts a consistent type (#31065)
* Make ansible_selinux facts a consistent type Rather than returning a bool if the Python library is missing, return a dict with one key containing a message explaining there is no way to tell the status of SELinux on the system becasue the Python library is not present. * Fix unit test
This commit is contained in:
@@ -278,7 +278,7 @@ class TestSelinuxFacts(BaseFactsTest):
|
||||
fact_collector = self.collector_class()
|
||||
facts_dict = fact_collector.collect(module=module)
|
||||
self.assertIsInstance(facts_dict, dict)
|
||||
self.assertFalse(facts_dict['selinux'])
|
||||
self.assertEqual(facts_dict['selinux']['status'], 'Missing selinux Python library')
|
||||
return facts_dict
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user