aboutsummaryrefslogtreecommitdiffstats
path: root/ddns/cfg_parser.py
blob: e8134cd134cc1d715678f0d474b2a2f9ac0257ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import yaml
import io
import os

cfg_file = None
cfg = None

def read_config():
	global cfg

	if not cfg_file or not os.path.exists(cfg_file):
		return None

	with io.open(cfg_file, 'r') as fp:
		_cfg = yaml.load(fp)

	cfg = _cfg