Python Fabric - No hosts found. Please specify (single) host string for connection:

Tampa picture Tampa · Mar 25, 2013 · Viewed 17.3k times · Source

How do I get No hosts found. Please specify (single) host string for connection: ?

How to a resolve with fabric?

def bootstrap():
    host = 'ec2-54-xxx.xxx.xxx.compute-1.amazonaws.com'
    env.hosts = [host]
    env.user = "ubuntu"
    env.key_filename = "/home/ubuntu/omg.pem"

> command run
>> fab bootstrap
> No hosts found. Please specify (single) host string for connection: 

Answer

Raul Gomez picture Raul Gomez · Jun 8, 2014

Also you can use env.host_string instead of env.hosts:

def bootstrap():
    env.host_string # 'ec2-54-xxx.xxx.xxx.compute-1.amazonaws.com'
    env.user = "ubuntu"
    env.key_filename = "/home/ubuntu/omg.pem"