Commit Graph

7 Commits

Author SHA1 Message Date
Pranesh Pandurangan 473e2febc0 Add an audit unregister option
Allow users to remove audit scripts through a simple CLI call. The
unregister-audit call will remove an audit script from audit.cfg,
thus stopping the execution of all but the currently scheduled audit
scripts.

partially implements blueprint simple api
Change-Id: I1d5328d87b607c2f5cfdaebb7448a11673f38d48
2014-06-11 03:07:58 +00:00
Pranesh Pandurangan 0be7808705 Move register-audit/repair code to backend
Abstract out cfg file operations in the register workflow. Changed
the get_driver code in engine to be static, so we can call it from
main too.

Added a new function in file_backend to return the config file given
the script type. Eg. return audit_cfg for audit.

Added a new function in file_backend to replace check_duplicate, that
returns True if a script already is already registered.

Added a couple of string variables in base.py

The function get_cfg_file, when using a db, will actually return a
table. So this belongs in the backend, the code refactor here ensures
this function is not called in the main() code.

Raise errors instead of returning None in the some backend functions

Completes blueprint backend-abstraction
Change-Id: I20d6bd46caf56c750e4b1193a6f5d00ce4e930f6
2014-06-09 19:50:56 -07:00
pran1990 e9f7137ceb move repair-related code to backend
Add two functions in filebackend, to retrieve all repairs, and to
retrieve an repair script's config given the name.

Replace occurences of utils.load_yaml in engine.py with calls to
above functions

Change-Id: If7ed5c44b771aa76b94697cca16b251a167e4956
2014-06-05 09:26:32 +00:00
pran1990 e7c8fee0a8 move audit-related code to backend
Add two functions in filebackend, to retrieve all audits, and to
retrieve an audit script's config given the name.

Replace occurences of utils.load_yaml in engine.py with calls to
above functions

Change-Id: Ia204d0db8a078c28ce27a2ae2ed57eb8b7fdf23b
2014-06-05 02:24:19 -07:00
pran1990 d4fcac48f1 Move cfg file creation to driver
Added code to load the file backend as a driver in engine __init__,
and a function in FileBackend to create cfg files.

Also added extra field in engine.cfg to specify what kind of backend
to use.

Change-Id: I6d3f24d4f676c72c94afff2c4c7f54a35cf1d4b1
2014-06-02 20:31:14 +00:00
pran1990 3499d899c8 Make backends into drivers, loadable as entry points
Added base.py, which has classes for backends to derive from. This is
the stevedore suggested way of writing drivers.
stevedore.readthedocs.org/en/latest/tutorial/creating_plugins.html

Added entrypoints to setup.cfg

implements blueprint backend-abstraction
Change-Id: Ib53bd1ec930f15480e33b9105033e9999f96b842
2014-05-30 20:09:12 +00:00
pran1990 9e68d9cdd1 Add some structure for backend abstraction
Add some backend placeholders.

implements blueprint backend-abstraction
Change-Id: Ia6bd3020d2f666ee317e1cf89ae2f3e10e6977aa
2014-05-30 08:41:29 +00:00