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