fabric/fabric — Issue #509: sudo needs a clean method to invoke -k
Author: teichopsia
Created: 2011-12-19 00:26:02+00:00
State: open

right now if I want to clear credentials after a sudo run I can't directly call sudo -k without modifying sudo_prefix:

def sudoclear():
if env.hosts:
sudosave=env.sudo_prefix
env.sudo_prefix="sudoclear"
sudo("",shell=False,combine_stderr=True)
env.sudo_prefix=sudosave

and likewise patching operations.py:_sudo_prefix

def _sudo_prefix(user):
if env.sudo_prefix=="sudoclear":
return "sudo -k"
...

or something similar. clean handling -K is also food for thought.