From 74d53a7039ce07c122b105d32d0e7b41df71b004 Mon Sep 17 00:00:00 2001
From: Karsten Hopp <karsten@redhat.com>
Date: Wed, 13 Nov 2019 11:23:44 +0100
Subject: [PATCH 15/15] don't use inline dict for message body

Signed-off-by: Karsten Hopp <karsten@redhat.com>
---
 callback_plugins/fedora_messaging_callback.py | 24 ++++++++++---------
 .../fedora_messaging_callback2.py             | 24 ++++++++++---------
 2 files changed, 26 insertions(+), 22 deletions(-)

diff --git a/callback_plugins/fedora_messaging_callback.py b/callback_plugins/fedora_messaging_callback.py
index 372080212..620fe456e 100644
--- a/callback_plugins/fedora_messaging_callback.py
+++ b/callback_plugins/fedora_messaging_callback.py
@@ -64,14 +64,14 @@ class CallbackModule(CallbackBase):
                 try:
                     msg = Message(
                         topic="ansible.playbook.start",
-                        body=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,
-                        ),
+                        body={
+                            '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
+                        }
                     )
                     publish(msg)
                 except PublishReturned as e:
@@ -90,9 +90,11 @@ class CallbackModule(CallbackBase):
         try:
             msg = Message(
                 topic="ansible.playbook.complete",
-                body=dict(
-                    playbook=self.playbook_path, userid=getlogin(), results=results
-                ),
+                body={
+                    'playbook': self.playbook_path,
+                    'userid': getlogin(),
+                    'results': results
+                )
             )
             publish(msg)
         except PublishReturned as e:
diff --git a/callback_plugins/fedora_messaging_callback2.py b/callback_plugins/fedora_messaging_callback2.py
index 0b08d6b36..dc4176376 100644
--- a/callback_plugins/fedora_messaging_callback2.py
+++ b/callback_plugins/fedora_messaging_callback2.py
@@ -82,14 +82,14 @@ class CallbackModule(CallbackBase):
                 try:
                     msg = Message(
                         topic="ansible.playbook.start",
-                        body=dict(
-                            playbook=path,
-                            userid=getlogin(),
-                            extra_vars=play._variable_manager.extra_vars,
-                            inventory=play._variable_manager._inventory._sources,
-                            playbook_checksum=secure_hash(path),
-                            check=self.play_context.check_mode,
-                        ),
+                        body={
+                            'playbook': path,
+                            'userid': getlogin(),
+                            'extra_vars': play._variable_manager.extra_vars,
+                            'inventory': play._variable_manager._inventory._sources,
+                            'playbook_checksum': secure_hash(path),
+                            'check': self.play_context.check_mode
+                        }
                     )
                     publish(msg)
                 except PublishReturned as e:
@@ -108,9 +108,11 @@ class CallbackModule(CallbackBase):
         try:
             msg = Message(
                 topic="ansible.playbook.complete",
-                body=dict(
-                    playbook=self.playbook_path, userid=getlogin(), results=results
-                ),
+                body={
+                    'playbook': self.playbook_path,
+                    'userid': getlogin(),
+                    'results': results
+                }
             )
             publish(msg)
         except PublishReturned as e:
-- 
2.21.0

