Create audit and repair cfg at startup

If those files don't exist, create them at startup. Else adding the first audit
or repair script fails because the cfg file doesn't exist.

Change-Id: I9143f59364167e98f69616351b4ac1df8ebd4ff8
This commit is contained in:
pran1990 2014-05-18 15:43:30 -07:00 committed by Pranesh Pandurangan
parent b2ea4abbdb
commit 1d38e2ca2b
1 changed files with 8 additions and 0 deletions

View File

@ -101,6 +101,14 @@ def start_engine(args):
}
}
utils.write_yaml(cfg, engine_cfg)
# create cfg files
for filename in ['audit_cfg', 'repair_cfg']:
try:
with open(cfg_data[filename]):
pass
except IOError:
with open(cfg_data[filename], 'a'):
pass
LOG.info('Added %s to engine cfg', args.name)
entropy_engine = Engine(args.name, **cfg_data)
entropy_engine.run()