diff options
Diffstat (limited to 'src/facter.py')
| -rw-r--r-- | src/facter.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/facter.py b/src/facter.py index 6f6ba87..e5fa799 100644 --- a/src/facter.py +++ b/src/facter.py @@ -6,17 +6,17 @@ import sys import src.globalvars as gv -# Populate src.globalvars.facts on import -_uname = platform.uname() -gv.facts["hostname"] = _uname.node -gv.facts["system"] = _uname.system -gv.facts["kernel"] = _uname.release -gv.facts["arch"] = _uname.machine -gv.facts["cpus"] = multiprocessing.cpu_count() - -with open(os.path.join(gv.builddir, "ccinfo"), "r") as ccinfo: - gv.facts["cc"] = ccinfo.readlines()[-1][:-1] +def collect_facts(): + # Populate src.globalvars.facts on import + _uname = platform.uname() + gv.facts["hostname"] = _uname.node + gv.facts["system"] = _uname.system + gv.facts["kernel"] = _uname.release + gv.facts["arch"] = _uname.machine + gv.facts["cpus"] = multiprocessing.cpu_count() + with open(os.path.join(gv.builddir, "ccinfo"), "r") as ccinfo: + gv.facts["cc"] = ccinfo.readlines()[-1][:-1] def get_libc_version(bin=None): bin = bin or sys.executable |
