mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-03 20:54:24 -07:00
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:
commit
1b4f1e1756
1 changed files with 16 additions and 13 deletions
|
@ -120,8 +120,11 @@ 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 = {}
|
||||||
|
|
||||||
|
if load_on_init:
|
||||||
self.get_platform_facts()
|
self.get_platform_facts()
|
||||||
self.get_distribution_facts()
|
self.get_distribution_facts()
|
||||||
self.get_cmdline()
|
self.get_cmdline()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue