|
From: | Brown, Rodrick |
Subject: | Re: [Fab-user] Dynamic hosts not supported by -H? |
Date: | Thu, 12 Jul 2012 16:15:47 -0400 |
Fabric is just python there is no magic to it.
$ cat >fabfile1.py import fabric from fabric.api import run, env import os hostlist = '/tmp/hostlist' if (os.path.exists(hostlist)): env.hosts = list(file(hostlist).readlines())[:-1] print(env.hosts) def checkproc(): run('/bin/ps -elf |grep java') $ fab checkproc -f fabfile1.py
From: fab-user-bounces+address@hidden [mailto:fab-user-bounces+address@hidden
On Behalf Of Ryan Bales Hello all, I'm trying to build a web app around a few fabric scripts, and I need to supply a dynamic list of hosts to the scripts. I saw the -H switch, but it apparently only works when env.hosts is
defined in the fabric script. I also looked at command-line kwargs for methods, but the methods won't even be executed without env.hosts being defined. Can someone point me in the right direction? Thanks,
-- Please visit our website for important disclaimers/disclosures regarding Knight’s products and services: http://www.knight.com/KnightEmailDisclaimer.html |
[Prev in Thread] | Current Thread | [Next in Thread] |