diff options
author | Toshio くらとみ <toshio@batcave01.phx2.fedoraproject.org> | 2016-01-30 05:15:25 +0000 |
---|---|---|
committer | Toshio くらとみ <toshio@batcave01.phx2.fedoraproject.org> | 2016-01-30 05:15:25 +0000 |
commit | 998e9cc4ecccbaee402eada2ff3969d54d45f7f0 (patch) | |
tree | 349f04b8282d09431574afb8e78299b5ff08a650 /callback_plugins | |
parent | a9062410e556352e3c971084f2c4df8930c462df (diff) | |
download | ansible-998e9cc4ecccbaee402eada2ff3969d54d45f7f0.tar.gz ansible-998e9cc4ecccbaee402eada2ff3969d54d45f7f0.tar.xz ansible-998e9cc4ecccbaee402eada2ff3969d54d45f7f0.zip |
Fix setting of playbook
Diffstat (limited to 'callback_plugins')
-rw-r--r-- | callback_plugins/fedmsg_callback2.py | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/callback_plugins/fedmsg_callback2.py b/callback_plugins/fedmsg_callback2.py index 391191385..9cc7126a5 100644 --- a/callback_plugins/fedmsg_callback2.py +++ b/callback_plugins/fedmsg_callback2.py @@ -61,18 +61,22 @@ class CallbackModule(CallbackBase): except ValueError: pass self.play = None + self.playbook = None super(CallbackModule, self).__init__() + def v2_playbook_on_start(self, playbook): + self.playbook = playbook + def v2_playbook_on_play_start(self, play): # This gets called once for each play.. but we just issue a message once # for the first one. One per "playbook" - if play: + if self.playbook: # figure out where the playbook FILE is - path = os.path.abspath(play.playbook.filename) + path = os.path.abspath(self.playbook.filename) # Bail out early without publishing if we're in --check mode - if play.playbook.check: + if self.playbook.check: return if not self.playbook_path: @@ -81,10 +85,10 @@ class CallbackModule(CallbackBase): msg=dict( playbook=path, userid=getlogin(), - extra_vars=play.playbook.extra_vars, - inventory=play.playbook.inventory.host_list, - playbook_checksum=play.playbook.check, - check=play.playbook.check, + extra_vars=self.playbook.extra_vars, + inventory=self.playbook.inventory.host_list, + playbook_checksum=self.playbook.check, + check=self.playbook.check, ), ) self.playbook_path = path |