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:
Sam Doran 2017-10-05 09:19:08 -04:00 committed by GitHub
commit e7902d888c
2 changed files with 12 additions and 7 deletions

View file

@ -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