1
saber000 2015-02-06 15:51:02 +08:00 1
用两个fabfile分开B和C的操作,先把对C的操作从A扔到B上,在A中操纵B执行fab命令
|
2
dongweiming 2015-02-06 23:20:40 +08:00 1
你可以看原作者的:
http://bitprophet.org/blog/2012/11/05/gateway-solutions/ 或者这样? # coding=utf-8 from fabric.api import run, env from fabric.exceptions import NetworkError via = [('user1@server1:22', '123'), ('user2@server2:22', '456'), ('user3@serve3:22', '789')] try: for host, passwd in via: env.gateway = env.host_string env.host_string = host env.password = passwd run('id') except NetworkError as e: print e |