mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-04-29 10:10:19 +00:00
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:
parent
890bc7ea99
commit
77ac199348
2
Makefile
2
Makefile
@ -17,7 +17,7 @@ default: config dirs template css docs
|
|||||||
all: default
|
all: default
|
||||||
|
|
||||||
predepend:
|
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 init
|
||||||
git submodule update
|
git submodule update
|
||||||
touch predepend
|
touch predepend
|
||||||
|
|||||||
@ -72,11 +72,9 @@ Actions run commands with this contract (version 1.1):
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import contract
|
|
||||||
import os
|
import os
|
||||||
import pipes, shlex, subprocess
|
import pipes, shlex, subprocess
|
||||||
|
|
||||||
contract.checkmod(__name__)
|
|
||||||
|
|
||||||
def run(action, options = None, async = False):
|
def run(action, options = None, async = False):
|
||||||
"""Safely run a specific action as the current user.
|
"""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.
|
async: run asynchronously or wait for the command to complete.
|
||||||
|
|
||||||
run_as_root: execute the command through sudo.
|
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"
|
DIRECTORY = "actions"
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user