Paver task that is called before termination (after any/all other tasks)?

25 views
Skip to first unread message

gustavs...@gmail.com

unread,
May 29, 2013, 4:28:07 PM5/29/13
to pa...@googlegroups.com
I understand there is an auto task that is run when pavement is launched. (http://pythonhosted.org/Paver/tips.html?highlight=auto)

Similarly, I would like an 'end' task that is run before pavement terminates.

For example:

@task
def end():
    # cleanup steps
    ssh.close()

Is there a way to do this?

In my specific case, I have an ssh connection that is used by my other tasks, and I would like to be able to close it, regardless if I called all previous tasks or just one of them.

Thanks!

Almad

unread,
Jun 1, 2013, 1:17:05 PM6/1/13
to pa...@googlegroups.com
Hi,

there is currently no way to do it. However, I don't know whether this is a good idea; for this use-case, you should probably call ssh_end task in your pavements.

For example, I don't think it's good to call this task after "paver sdist". 

Regards,

Lukas

Dne středa, 29. května 2013 22:28:07 UTC+2 gustavs...@gmail.com napsal(a):

jhermann

unread,
Jun 3, 2013, 6:22:35 AM6/3/13
to pa...@googlegroups.com
One way it could be done would be a counterpart to @needs named @triggers. This would ensure that listed tasks are run *after* (vs. *before* as with @needs) any task that triggers them.

Almad

unread,
Jun 4, 2013, 7:54:58 AM6/4/13
to pa...@googlegroups.com
That is a good idea -- added to issue tracker https://github.com/paver/paver/issues/108

Lukas


2013/6/3 jhermann <Juergen...@1und1.de>
One way it could be done would be a counterpart to @needs named @triggers. This would ensure that listed tasks are run *after* (vs. *before* as with @needs) any task that triggers them.

--
You received this message because you are subscribed to the Google Groups "paver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to paver+un...@googlegroups.com.
To post to this group, send email to pa...@googlegroups.com.
Visit this group at http://groups.google.com/group/paver?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages