Merge pull request #9555 from bcoca/low_cost_facts

allow fact objects to be instantiated w/o triggering all fact collection
This commit is contained in:
Brian Coca 2015-02-11 20:57:40 -05:00
commit 1b4f1e1756

View file

@ -120,20 +120,23 @@ class Facts(object):
{ 'path' : '/usr/bin/pkg', 'name' : 'pkg' }, { 'path' : '/usr/bin/pkg', 'name' : 'pkg' },
] ]
def __init__(self): def __init__(self, load_on_init=True):
self.facts = {} self.facts = {}
self.get_platform_facts()
self.get_distribution_facts() if load_on_init:
self.get_cmdline() self.get_platform_facts()
self.get_public_ssh_host_keys() self.get_distribution_facts()
self.get_selinux_facts() self.get_cmdline()
self.get_fips_facts() self.get_public_ssh_host_keys()
self.get_pkg_mgr_facts() self.get_selinux_facts()
self.get_lsb_facts() self.get_fips_facts()
self.get_date_time_facts() self.get_pkg_mgr_facts()
self.get_user_facts() self.get_lsb_facts()
self.get_local_facts() self.get_date_time_facts()
self.get_env_facts() self.get_user_facts()
self.get_local_facts()
self.get_env_facts()
def populate(self): def populate(self):
return self.facts return self.facts