20 lines
682 B
Python
20 lines
682 B
Python
"""Universal homelab and fleet inventory collector and deduplicator."""
|
|
|
|
__version__ = "1.0.1"
|
|
|
|
_yaml_warning_emitted = False
|
|
|
|
def get_yaml_module():
|
|
"""Return the yaml module if installed, or None while emitting an actionable warning on stderr."""
|
|
global _yaml_warning_emitted
|
|
try:
|
|
import yaml
|
|
return yaml
|
|
except ImportError:
|
|
import sys
|
|
if not _yaml_warning_emitted:
|
|
sys.stderr.write("[WARN] 'pyyaml' module is not installed in the Python environment. "
|
|
"Install it via: pip install pyyaml (or pip install -r requirements.txt)\n")
|
|
_yaml_warning_emitted = True
|
|
return None
|