|
From: | Chris Spencer |
Subject: | Re: [Fab-user] How to mix the task and runs_once decorator |
Date: | Thu, 1 May 2014 18:16:10 -0400 |
I struggled with this for a bit as well, and the way i have approached this is to use execute inside the task you only want to run_once.from fabric.api import task,runs_once, execute@task@runs_oncedef report_pending_updates():execute(check_for_updates)#report heredef check_for_updates():...HTHJeffOn Thu, Jan 9, 2014 at 3:17 PM, Chris Spencer <address@hidden> wrote:
_______________________________________________Regards,but this causes Fabric to not detect the task. Switching the decorator order results in the same error.def report_pending_updates():@task@runs_onceI've tried constructing my task like:However, since I have multiple hosts, it runs report_pending_updates for each host, showing the report multiple times.fab production check_for_updates report_pending_updatesHow 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:
...
Chris
Fab-user mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/fab-user
[Prev in Thread] | Current Thread | [Next in Thread] |