fab-user
[Top][All Lists]
Advanced

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

[Fab-user] How to mix the task and runs_once decorator


From: Chris Spencer
Subject: [Fab-user] How to mix the task and runs_once decorator
Date: Thu, 9 Jan 2014 15:17:46 -0500

How do you mix the @task and @runs_once decorator?

I have a task (check_for_updates) that checks installed Python packages on each host and records which ones need updates. I then have a task (report_pending_updates) that displays a report showing which hosts require updates. So I'm doing:

    fab production check_for_updates report_pending_updates

However, since I have multiple hosts, it runs report_pending_updates for each host, showing the report multiple times.

I've tried constructing my task like:

@runs_once
@task
def report_pending_updates():
    ...

but this causes Fabric to not detect the task. Switching the decorator order results in the same error.

Regards,
Chris

reply via email to

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