mirror of
https://github.com/netbox-community/netbox-docker.git
synced 2024-11-26 01:43:43 +01:00
13 lines
256 B
Python
13 lines
256 B
Python
from pathlib import Path
|
|
|
|
from ruamel.yaml import YAML
|
|
|
|
|
|
def load_yaml(yaml_file: str):
|
|
yf = Path(yaml_file)
|
|
if not yf.is_file():
|
|
return None
|
|
with yf.open("r") as stream:
|
|
yaml = YAML(typ="safe")
|
|
return yaml.load(stream)
|