I have a fabfile like the following:
@hosts(\'host1\')
def host1_deploy():
\"\"\"Some logic that is specific to deploying to host1\"\"\"
@hosts(\'host2\
There's probably a better way to handle it, but you could pass both hosts to deploy(), and then in host1_deploy() and host2_deploy() check env.host:
def host1_deploy():
if env.host in ['host1']:
run(whatever1)
def host2_deploy():
if env.host in ['host2']:
run(whatever2)
@hosts('host1','host2')
def deploy():
host1_deploy()
host2_deploy()