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
This commit is contained in:
Sunil Mohan Adapa 2014-04-05 09:41:03 +05:30
parent 890bc7ea99
commit 77ac199348
2 changed files with 1 additions and 9 deletions

View File

@ -17,7 +17,7 @@ default: config dirs template css docs
all: default
predepend:
sudo sh -c "apt-get install augeas-tools libpython2.7 pandoc psmisc python2.7 python-augeas python-passlib python-bcrypt python-bjsonrpc python-cheetah python-cherrypy3 python-simplejson python-contract sudo"
sudo sh -c "apt-get install augeas-tools libpython2.7 pandoc psmisc python2.7 python-augeas python-passlib python-bcrypt python-bjsonrpc python-cheetah python-cherrypy3 python-simplejson sudo"
git submodule init
git submodule update
touch predepend

View File

@ -72,11 +72,9 @@ Actions run commands with this contract (version 1.1):
"""
import contract
import os
import pipes, shlex, subprocess
contract.checkmod(__name__)
def run(action, options = None, async = False):
"""Safely run a specific action as the current user.
@ -104,12 +102,6 @@ def _run(action, options = None, async = False, run_as_root = False):
async: run asynchronously or wait for the command to complete.
run_as_root: execute the command through sudo.
pre:
os.sep not in action
inv:
True # Actions directory hasn't changed. It's hardcoded :)
"""
DIRECTORY = "actions"