mirror of
https://github.com/netbox-community/netbox-docker.git
synced 2024-12-04 05:43:35 +01:00
11 lines
236 B
Python
11 lines
236 B
Python
|
from ruamel.yaml import YAML
|
||
|
from pathlib import Path
|
||
|
|
||
|
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)
|