1

Consider this simple fabric file:

def wrapper():
    f1()
    f2()

@hosts([host1])
def f1():
    run('ls')

@hosts([host2])
def f2():
    run('uname')

By running fab wrapper you get a prompt for:

No hosts found. Please specify a (single) host string for connection:

How can I make wrapper() ignore any hosts, and assume all sub-tasks will handle that aspect?

Yuval Adam
  • 161,610
  • 92
  • 305
  • 395
  • Hmm, just found a very similar question: http://stackoverflow.com/questions/5346135/can-a-python-fabric-task-invoke-other-tasks-and-respect-their-hosts-lists – Yuval Adam Aug 14 '11 at 10:09

1 Answers1

0

Fabric issue #21 deals with this longstanding problem.

execute() now supports this behavior.

Yuval Adam
  • 161,610
  • 92
  • 305
  • 395