title: Fabric fails with Name lookup failed when celery is run with eventlet
body: <p>I have a celery task to run a sudo command on a remote machine using fabric:</p>
  
  <pre><code>@app.task(soft_time_limit=600)
  def run_puppet_agent(hostname):
      try:
          fabric_client = Fabric(hostname)
          result = fabric_client.run_command('puppet agent -t', True, True)
          if result.return_code == 0 or result.return_code == 2:
                  return True, 'Puppet agent run successfully'
          else:
              raise Exception('Command %s run failed with a non zero or non-2 error code, '
                              '0 and 2 are status codes for successful puppet runs, returned     code %s'
                              % ('sudo puppet agent -t', result.return_code))
      except SoftTimeLimitExceeded:
          raise Exception('Puppet agent run took more than 600 seconds')
      except Exception as e:
          #run_puppet_agent.retry(args=[hostname], countdown=20)
          LOG.info('')
          raise Exception('Puppet agent failed with error message %s' % e.message)
  </code></pre>
  
  <p>if I run the celery workers as:</p>
  
  <pre><code>celery -A phantom.celery.manage worker --loglevel=info
  </code></pre>
  
  <p>it works fine !! But when I run the workers with eventlet as:</p>
  
  <pre><code>celery -A phantom.celery.manage worker --loglevel=info -P eventlet -c 15
  </code></pre>
  
  <p>It goes terribly bad and gives me this exception:</p>
  
  <pre><code>[WARNING/MainProcess] File     "/Users/uruddarraju/Phantom/phantom/tasks/fabric_tasks.py", line 19, in run_puppet_agent
  [WARNING/MainProcess] result = fabric_client.run_command('puppet agent -t', True, True)
  [WARNING/MainProcess] File "/Users/uruddarraju/Phantom/phantom/util/fabric/fabric_util.py", line 43, in run_command
  [WARNING/MainProcess] return sudo(command, quiet=False)
  [WARNING/MainProcess] File "/Library/Python/2.7/site-packages/fabric/network.py", line 639, in host_prompting_wrapper
  [WARNING/MainProcess] return func(*args, **kwargs)
  [WARNING/MainProcess] File "/Library/Python/2.7/site-packages/fabric/operations.py", line 1095, in sudo
  [stderr=stderr, timeout=timeout, shell_escape=shell_escape,
  [WARNING/MainProcess] File "/Library/Python/2.7/site-packages/fabric/operations.py", line 909, in _run_command
  [WARNING/MainProcess] channel=default_channel(), command=wrapped_command, pty=pty,
  [WARNING/MainProcess] File "/Library/Python/2.7/site-packages/fabric/state.py", line 390, in default_channel
  [WARNING/MainProcess] chan = _open_session()
  [WARNING/MainProcess] File "/Library/Python/2.7/site-packages/fabric/state.py", line 382, in _open_session
  [WARNING/MainProcess] return connections[env.host_string].get_transport().open_session()
  [WARNING/MainProcess] File "/Library/Python/2.7/site-packages/fabric/network.py", line 151, in __getitem__
  [WARNING/MainProcess] self.connect(key)
  [WARNING/MainProcess] File "/Library/Python/2.7/site-packages/fabric/network.py", line 143, in connect
  [WARNING/MainProcess] self[key] = connect(user, host, port, cache=self)
  [WARNING/MainProcess] File "/Library/Python/2.7/site-packages/fabric/network.py", line 533, in connect
  [WARNING/MainProcess] raise NetworkError('Name lookup failed for %s' % host, e)
  [WARNING/MainProcess] NetworkError: Name lookup failed for &lt;hostname&gt;
  </code></pre>
  
  <p>WARNING/MainProcess] None</p>
  
  <p>FYI: I have other tasks that have different HTTP API calls and hence though eventlet would help but not working for me in this case</p>