From 78808fc4ccea06dab1ed20a643c64f56fa89527f Mon Sep 17 00:00:00 2001 From: Pomin Wu Date: Mon, 9 May 2016 21:59:26 +0800 Subject: [PATCH] Fixed `ansible_os_family` variable on OS X (#15768) (#15773) Fixed `ansible_os_family` variable on OS X --- lib/ansible/module_utils/facts.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/ansible/module_utils/facts.py b/lib/ansible/module_utils/facts.py index 690403f8106..d0884bced42 100644 --- a/lib/ansible/module_utils/facts.py +++ b/lib/ansible/module_utils/facts.py @@ -179,7 +179,7 @@ class Facts(object): # about those first. if load_on_init: self.get_platform_facts() - self.facts.update(Distribution().populate()) + self.facts.update(Distribution(module).populate()) self.get_cmdline() self.get_public_ssh_host_keys() self.get_selinux_facts() @@ -647,17 +647,19 @@ class Distribution(object): FreeBSD = 'FreeBSD', HPUX = 'HP-UX', openSUSE_Leap = 'Suse' ) - def __init__(self): + def __init__(self, module): self.system = platform.system() self.facts = {} + self.module = module def populate(self): if self.system == 'Linux': self.get_distribution_facts() + elif self.system == 'Darwin': + self.get_distribution_facts() return self.facts def get_distribution_facts(self): - # The platform module provides information about the running # system/distribution. Use this as a baseline and fix buggy systems # afterwards