Ignore conf files starting with . when generating config
This commit is contained in:
@@ -594,12 +594,17 @@ class DNSManager:
|
||||
try:
|
||||
with open(view_cfg.config_file, 'w') as cfh:
|
||||
for file in os.listdir(view_cfg.config_dir):
|
||||
cfgfile = os.path.join(view_cfg.config_dir, file)
|
||||
if not file.endswith('.conf') or not os.path.isfile(cfgfile):
|
||||
if file.startswith('.') or not file.endswith('.conf'):
|
||||
continue
|
||||
|
||||
cfgfile = os.path.join(view_cfg.config_dir, file)
|
||||
if not os.path.isfile(cfgfile):
|
||||
continue
|
||||
|
||||
with open(cfgfile, 'r') as fh:
|
||||
cfh.write(fh.read())
|
||||
cfh.write('\n')
|
||||
|
||||
except Exception as e:
|
||||
raise RuntimeError(f'unable to generate view config: {e}')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user