title: Call /etc/sudoers commands from fabric
body: <p>In my <code>/etc/sudoers</code> I have:</p>
  
  <pre><code># Allow the picky user to restart its own gunicorn process
  picky ALL=(ALL) NOPASSWD: /usr/bin/supervisorctl restart picky
  </code></pre>
  
  <p>I can indeed run this command from the picky user:</p>
  
  <pre><code>$ su picky
  $ sudo supervisorctl restart picky
  </code></pre>
  
  <p>In my fabfile.py I have the following:</p>
  
  <pre><code>from fabric.api import sudo
  
  def restart():
      sudo("supervisorctl restart picky")
  </code></pre>
  
  <p>However, when I run my fabric file, it still prompts for a password:</p>
  
  <pre><code>[picky@myhost] sudo: supervisorctl restart picky
  [picky@myhost] out: sudo password: 
  </code></pre>
  
  <p>How can I run sudo commands inside Fabric such that I don't need to provide a password?</p>
  
  <p><em>Edit</em>:</p>
  
  <p>I've noticed this works:</p>
  
  <pre><code>from fabric.api import run
  
  def restart():
      run("sudo supervisorctl restart picky")
  </code></pre>