|
From: | Ben Abrams |
Subject: | Re: [Fab-user] fabric2 cd with multiple servers |
Date: | Thu, 12 Oct 2017 20:21:41 -0700 |
I'm learning the fabric2 api and wanted to know the best way to run a command with a particular working directory on a set of servers.The README indicates that there is a 'execute' method on Group, but this doesn't seem to be the case. I was able to get code below to work by calling run on each connection in the group. Is there a more succinct way to do this besides the "cd foo && cmd" method? Or am I overlooking something?-----from fabric import ThreadingGroupg=ThreadingGroup('host1','host2') g.run('cd /tmp && ls foo')-- or --from fabric import ThreadingGroupg=ThreadingGroup('host1','host2') for c in g:with c.cd('/tmp'):c.run('ls foo')-----Regards,Lamont
_______________________________________________
Fab-user mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/fab-user
[Prev in Thread] | Current Thread | [Next in Thread] |