Allow sysconfig overrides from the config partition.

This commit is contained in:
Jeffrey Townsend
2017-02-21 18:13:01 +00:00
parent 9f4581f8af
commit 840389d897

View File

@@ -31,7 +31,9 @@ class DotDict(dict):
class OnlSystemConfig(object):
SYSTEM_CONFIG_DIR = '/etc/onl/sysconfig'
SYSTEM_CONFIG_DIRS = [ '/etc/onl/sysconfig',
'/mnt/onl/config/sysconfig',
]
def __init__(self):
@@ -45,10 +47,12 @@ class OnlSystemConfig(object):
aarch64='arm64')[pp.machine()]
self.config = {}
for f in sorted(os.listdir(self.SYSTEM_CONFIG_DIR)):
if f.endswith('.yml'):
d = onl.onlyaml.loadf(os.path.join(self.SYSTEM_CONFIG_DIR, f), self.variables)
self.config = onl.util.dmerge(self.config, d)
for dir_ in self.SYSTEM_CONFIG_DIRS:
if os.path.isdir(dir_):
for f in sorted(os.listdir(dir_)):
if f.endswith('.yml'):
d = onl.onlyaml.loadf(os.path.join(dir_, f), self.variables)
self.config = onl.util.dmerge(self.config, d)
self.config['pc'] = platform.platform_config