As noted in https://stackoverflow.com/questions/3737003/can-i-prevent-fabric-from-prompting-me-for-a-sudo-password, when you use the fabric sudo
command that command is sent to a shell. The real command that is executed contains a call to /bin/bash
in it, which is why it doesn't match with your sudoer entry.
To get around that, simply add shell=False
to your call:
from fabric.api import sudo
def restart():
sudo("supervisorctl restart picky", shell=False)
You might have to add the full path to supervisorctl
.