9 Commits

Author SHA1 Message Date
Sunil Mohan Adapa
5e25a432c3 Indentation updates
- No spaces at the beginning and end of a single line comment. (python code does this)
- Double space after a statement in a multi-line comment. (PEP-8)
- Enforce 79 character limit. (PEP-8)
- Empty line after a block ends make code more readable.
- Empty line at the end of a multi line comment. (python code seems to do this)
2014-08-17 19:45:00 +05:30
Sunil Mohan Adapa
4387c28495 Use os.path.join() instead of string concatenation in actions
Presence of / in action is not a problem at is check for early. Any other tricks
are secured against by the realpath() check immediately afterwards.
2014-08-17 19:40:58 +05:30
Sunil Mohan Adapa
642a4e10ff Improve exception handle when running actions
- Don't use depricated exception.message. Instead using exception.args
- Pass stdout output along with stderr in exception
- Handle possible exceptions such as ValueError, OSError in all cases
- Log all command executions and their errors
2014-08-17 19:39:14 +05:30
fonfon
0d5636a900 refactored actions to use exceptions instead of return-values 2014-07-10 18:27:49 +03:00
fonfon
a40d42eb60 made actions.py more pep8 compliant; added one more check to verify that an action is within the actions directory; moved actions directory path into the settings instead of hard-coding it 2014-07-10 06:02:33 +00:00
Sunil Mohan Adapa
77ac199348 Remove dependency on improperly used and unmaintained contract module
- contract module has not see a release since 2010
- Corresponding PEP has been deferred
- python-contract module in Debian is orphaned
- We are only using contract module in one method of one module
- That can be replaced with one line of check instead of depending on an
  entire module
- The code using contract module does not work
- There is already replacement one line code that is actually working
2014-04-05 10:10:22 +05:30
Nick Daly
16c994b787 Cleaned up missed references to privilegedactions. 2013-11-24 22:07:13 -06:00
Nick Daly
0349113e97 Commands can be executed asynchronously and as non-root.
If commands are executed synchronously, they'll return output and
error strings.  If commands are executed asynchronously, nothing is
returned.  We assume you can communicate with asynchronous processes
out-of-band.

Not every command needs to be executed as root, so there's a new
entry-point, *actions.run*, which executes actions as the current
user.
2013-11-24 18:42:15 -06:00
Nick Daly
6567dc1758 Renamed privilegedactions to actions. 2013-11-24 18:29:27 -06:00