mirror of
https://github.com/Telecominfraproject/OpenNetworkLinux.git
synced 2025-12-25 17:27:01 +00:00
Allow sysconfig overrides from the config partition.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user