我有以下Fabric任务:
def ssh_keygen(user, dir): env.user = user run("ssh-keygen %s" % dir)
我想用"执行"来调用它,但需要将任务传递给参数.即用户和目录
execute(ssh_keygen('jbloggs', '/home/jbloggs'), hosts=["server1"])
但是这不起作用:
No hosts found. Please specify (single) host string for connection: Traceback (most recent
反正有没有实现这个目标?
execute(ssh_keygen, 'jbloggs', '/home/jbloggs', host="server1")