From 474fef86618ccf71a6d6d482cd440695f1975ec5 Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: Wed, 22 Jan 2014 20:47:56 +0000 Subject: [PATCH] Try to silence fedmsg for --check runs. --- callback_plugins/fedmsg_callback.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/callback_plugins/fedmsg_callback.py b/callback_plugins/fedmsg_callback.py index 3a892fe769..b7d4025405 100644 --- a/callback_plugins/fedmsg_callback.py +++ b/callback_plugins/fedmsg_callback.py @@ -53,6 +53,10 @@ class CallbackModule(object): # figure out where the playbook FILE is path = os.path.abspath(play.playbook.filename) + # Bail out early without publishing if we're in --check mode + if play.playbook.check: + return + if not self.playbook: fedmsg.publish( modname="ansible", topic="playbook.start", @@ -68,6 +72,9 @@ class CallbackModule(object): self.playbook = path def playbook_on_stats(self, stats): + if not self.playbook: + return + results = dict([(h, stats.summarize(h)) for h in stats.processed]) fedmsg.publish( modname="ansible", topic="playbook.complete",