fab-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fab-user] sending in a list on the fab commandline


From: Simon Smith
Subject: [Fab-user] sending in a list on the fab commandline
Date: Tue, 20 Oct 2009 16:36:42 -0400

Given a fabfile.py as below, I would like to call something like:

fab example:host=host1,colors="red;blue"

...and have fab run the free and df commands on the remote host
"host1".  Is there a way to do this?  (Obviously I'm willing to change
my syntax on the commandline or in my python method.  My fallback plan
is to have my method split up a string such as red:blue into a list.)

def example(colors):
        for c in colors:
                if c == "red":
                        run("free")
                if c == "blue":
                        run("df")
                if c == "green":
                        run("ps")


Thanks,

Simon




reply via email to

[Prev in Thread] Current Thread [Next in Thread]