fab-user
[Top][All Lists]
Advanced

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

[Fab-user] Maybe my fabfile callables should get called with a parameter


From: Matthew Wilson
Subject: [Fab-user] Maybe my fabfile callables should get called with a parameter
Date: Tue, 7 Jul 2009 16:04:39 -0400

I'm daydreaming here, but I can see a scenario where I want to do one
thing on one box, and something slightly different on another box,
e.g.:

@hosts('a.example.com')
def foo():
    run('touch a.example.com')

@hosts('b.example.com')
def bar():
    run('touch b.example.com')

It would be neat if I could use the host currently being connected to
as a variable in my callable, like:

@hosts('a.example.com', 'b.example.com')
def baz(local_env):
    hostname = localenv['host']
    run('touch %s' % hostname)

Maybe this is already possible.

Matt


-- 
Matthew Wilson
address@hidden
http://tplus1.com




reply via email to

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