fab-user
[Top][All Lists]
Advanced

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

[Fab-user] awk's BEGIN/END in Fabric?


From: Dmitry Makovey
Subject: [Fab-user] awk's BEGIN/END in Fabric?
Date: Mon, 15 Oct 2012 14:46:31 -0600
User-agent: KMail/4.8.5 (Linux/3.4.11-1.fc16.x86_64; KDE/4.8.5; x86_64; ; )

Hi,

Is there a way to code certain tasks in Fabric to be executed **always** at 
the start (prior to all tasks) and then certain other tasks **always** in the 
end (after all tasks finished).

One of the usecases would be timing of entire chain of executed tasks. 
Consider this:

$ fab task1 task2 task3
...
Total Time: 1m13s

$ fab task3 task1 task4
...
Total Time: 1m20s

I know I can just use:

$ time fab ...

Or wrap each task with a timing decorator, but then how do I print summary? 
How do I make sure all operations have been timed? etc.

but for that I have to remember to type that in every time, I can also do an 
alias "fab=time fab" but that's again something else. 

Something like a global context manager... but I can't find any reference to 
such machinery either in Fabric or in generic Python docs. Did anybody ever 
have to solve this kind of problem? How did you solve it?

-- 
Dmitry Makovey
Web Systems Administrator
Athabasca University
(780) 675-6245
---
Confidence is what you have before you understand the problem
    Woody Allen

When in trouble when in doubt run in circles scream and shout 
     http://www.wordwizard.com/phpbb3/viewtopic.php?f=16&t=19330


-- 
    This communication is intended for the use of the recipient to whom it
    is addressed, and may contain confidential, personal, and or privileged
    information. Please contact us immediately if you are not the intended
    recipient of this communication, and do not copy, distribute, or take
    action relying on it. Any communications received in error, or
    subsequent reply, should be deleted or destroyed.
---



reply via email to

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