fab-user
[Top][All Lists]
Advanced

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

[Fab-user] fabric.api.execute return value


From: KoDer
Subject: [Fab-user] fabric.api.execute return value
Date: Tue, 8 Nov 2011 23:57:36 +0200

Hi, all.
I use fabric to manage VM's, so most of the time i call it recipes
from other python code.
I used to use subprocess & stdout + json to call recipes and pass
results back to main program but with new fabric.api.execute call
i don't need subprocess anymore and can integrate fabric directly in
my scripts. The problem is that execute don't pass back any results,
which my task returns. I can fix this with something like

def my_task(param1, param2, results <<< faked parameter, used to
collect results):
    .....
    results[env.hoststring] = current_result

but i think it would be useful to have this logic in execute method.

So i propose return from execute dict, which map host string to
result, which task returns.

Thanks

-- 
K.Danilov aka koder
ICQ:214286120
Skype:koder.ua
Tel:+38-050-4030512



reply via email to

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