Commit Graph

9 Commits

Author SHA1 Message Date
Pranesh Pandurangan 47e35d1d2c Add a stop engine call
Add a call to stop engine, this function just sets the enabled field
to false, and psutil terminates the process (equivalent to what we
do now). Also add psutil to requirements

Change-Id: Idc3edb2bf1c9ed55d7d77973c59e3d3562e2ad8b
2014-06-10 20:06:05 -07:00
pran1990 fb410e168e Use six for python 2/3 compatibility
Replace usage of dict.keys() with six.iterkeys(dict)

Change-Id: Ia7c99ea202fd0800c43a079b5b3fd094e7e66adb
2014-05-20 09:05:18 -07:00
pran1990 479662ad48 More logging fixes, and queue work
There were some bugs in the commit to create queues dynamically. The
engine now creates queues that are needed, and passes to react scripts.

Also made some fixes to example code, added some config files. They
contain usernames, but should be simple enough to modify and test

Change-Id: Ife1977b3f8d669024fd853b6691300b5dd4fd73f
2014-04-27 14:08:26 -07:00
pran1990 02dceddfa7 Introduce watchdog into entropy
Watch cfg files for changes, if so, call right callback.
Move audit.cfg and repair.cfg into cfg/ for easier
monitoring using watchdog.

Change-Id: Iace75f36f0bfb5b83fe53c7d63b110f10534808f
2014-02-24 19:15:09 -08:00
pran1990 5fc67635ad Enable stevedore and dynamic loading
Load modules dynamically, allowing better control over audit/react scripts
Change code structure a bit (put audit scripts in audit/ dir, react scripts
in repair/ dir)
Enable stevedore, for audit/react scripts installed with the package
Remove all homedir references

Change-Id: I7351d6b7cd9ca5ba9cfa9526dfbefbfecacc3dc8
2014-02-03 00:01:15 -08:00
pran1990 a16b654009 Use pause library for sleeping
As described in https://pypi.python.org/pypi/pause ,
the pause library has higher precision than the sleep lib,
and uses machine timestamp instead of counters.

Change-Id: I0f1135757ef8d1ed6e4eb203b84632ef5ec91977
2013-12-28 19:43:57 -08:00
Joshua Harlow 31413508a9 Small adjustments
Move entropy.py -> __main__.py so that it can just
be used by running $ python entropy (inside the
entropy root folder).

Also use yaml loading instead of json loading since
yaml allows for comments inside the file (yaml is
a superset of json).

Removed import json from __main__.py to keep pep8 happy

Also changed react.py to use a per module logger instead
of root logger

Change-Id: I5eb24319dee4f04891878c6e61cc4d7835b14d34
2013-12-16 23:47:17 -08:00
pran1990 8011130e2b Added a message queue
Added kombu, an interface to AMQP

Added react.py, sample reaction script with a kombu consumer.
Should be run separately. Just loops forever listening for
messages on the PASS_EVENTS queue/

Added queues.py, define an exchange and two queues to use
for the message queue

Replaced runthis.sh with audit.py, changed runthis.json to
audit.json. audit.py has send_message(), which sends a message
to the PASS_EVENTS queue

Configuration data for audit.py and react.py should be picked up
from audit.json and react.json.

Added H304, H302 to pep8 ignores

Change-Id: I32d5c007d3b00ee2ec33635bca1567da4447124c
2013-12-16 15:21:23 -08:00
pran1990 d3ae477176 Add code to stackforge/entropy
Because upstream wasn't mentioned when project was created, merge
existing upstream code manually. Current upstream is
https://github.com/pran1990/entropy

Add first draft of script in entropy/entropy.py. Utils used by the package are in entropy/utils.py

Added licenses to py scripts and LICENCE file

Added tox.ini, requirements.txt, and test-requirements.txt to setup
environments for gerrit's jenkins tests

Added sphinx docs in docs/. Instructions to build docs are in docs/README.rst

Change-Id: Ifff7cff38989e8c5509d3ecf4b34485893bfcfdb
2013-12-13 11:51:43 -08:00