From 77ac199348741c879a799a5b6b6c1da3120557ee Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Sat, 5 Apr 2014 09:41:03 +0530 Subject: [PATCH] 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 --- Makefile | 2 +- actions.py | 8 -------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 8d26d8ba9..0549fd6d7 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/actions.py b/actions.py index 506aff6b9..38ab78d25 100644 --- a/actions.py +++ b/actions.py @@ -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"