⚠️ Remove settings param from rules match, get_new_command and side_effect

This commit is contained in:
nvbn
2015-09-07 13:00:29 +03:00
parent 382eb8b86c
commit df4d2cc88d
154 changed files with 535 additions and 465 deletions
+3 -4
View File
@@ -4,15 +4,14 @@ from ..types import Command
@decorator
def sudo_support(fn, command, settings):
def sudo_support(fn, command):
"""Removes sudo before calling fn and adds it after."""
if not command.script.startswith('sudo '):
return fn(command, settings)
return fn(command)
result = fn(Command(command.script[5:],
command.stdout,
command.stderr),
settings)
command.stderr))
if result and isinstance(result, six.string_types):
return u'sudo {}'.format(result)