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

后端 未结 3 1533
南笙
南笙 2021-02-13 00:50

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-xx         


        
3条回答
  •  旧巷少年郎
    2021-02-13 01:15

    Alternatevly you can set env settings in outside your functions

    from fabric.api import env, run
    
    host = 'ec2-54-xxx.xxx.xxx.compute-1.amazonaws.com'
    env.hosts = [host]
    env.user = "ubuntu"
    env.key_filename = "/home/ubuntu/omg.pem"
    
    def test():
        run('ls -la')
    

提交回复
热议问题