title: Get the current value of env.hosts list with Python Fabric Library
body: <p>I've got this code (<code>foo</code> and <code>bar</code> are local servers):</p>
  
  <pre><code>env.hosts = ['foo', 'bar']
  
  def mytask():
      print(env.hosts[0])
  </code></pre>
  
  <p>Which, of course prints <em>foo</em> every iteration.</p>
  
  <p>As you probably know, Fabric iterates through the env.hosts list and executes mytask() on each of them this way:</p>
  
  <pre><code>fab mytask
  </code></pre>
  
  <p>does</p>
  
  <p><code>task</code> is executed on <code>foo</code><br>
  <code>task</code> is executed on <code>bar</code></p>
  
  <p>I'm looking for a way to get the <strong>current host</strong> in every iteration.</p>
  
  <p>Thanks,</p>