开发者

How do you define a wrapper function in Fabric?

Consider this simple fabric file:

def wrapper():
    f1()
    f2()

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

@hosts([host2])
def f2():
   开发者_如何学JAVA 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?


Fabric issue #21 deals with this longstanding problem.

execute() now supports this behavior.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜