doniyor
doniyor

Reputation: 37904

fabric - how to get host name while deploying

I have a fabfile

env.hosts = [
    # huge list, 80 hostnames
]
def dm():
    with cd('/home/project/application'):
        # how to get the actual hostname here, so I can run certain commands depending on hostname?

any ideas? fabric documentation gives me nothing on this

Upvotes: 3

Views: 1205

Answers (1)

falsetru
falsetru

Reputation: 369364

You can access hostname using env.host.

Upvotes: 3

Related Questions