⚠️ Remove settings param from rules match, get_new_command and side_effect
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user