summaryrefslogtreecommitdiff
path: root/lib/ansible/plugins/callback/hipchat.py
diff options
context:
space:
mode:
authorAdrian Likins <alikins@redhat.com>2016-08-08 11:04:06 -0400
committerBrian Coca <bcoca@users.noreply.github.com>2016-08-08 11:04:06 -0400
commitf21df311bcc71823865f2274b514d5ba437a7c12 (patch)
treeee28fef0c7aac0c0fa23e1462b2da2324c467d1b /lib/ansible/plugins/callback/hipchat.py
parent1a53d0c5032e6fb44c8964c7e1971fea1e433ae0 (diff)
downloadansible-f21df311bcc71823865f2274b514d5ba437a7c12.tar.gz
Fix hipchat callback "has no attribute display'" (#16998)
Use self._display for access to display object for the hipchat callback plugin. Fixes #16946
Diffstat (limited to 'lib/ansible/plugins/callback/hipchat.py')
-rw-r--r--lib/ansible/plugins/callback/hipchat.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/ansible/plugins/callback/hipchat.py b/lib/ansible/plugins/callback/hipchat.py
index 602827aeac..3422ad0788 100644
--- a/lib/ansible/plugins/callback/hipchat.py
+++ b/lib/ansible/plugins/callback/hipchat.py
@@ -31,6 +31,7 @@ except ImportError:
from ansible.plugins.callback import CallbackBase
from ansible.module_utils.urls import open_url
+
class CallbackModule(CallbackBase):
"""This is an example ansible callback plugin that sends status
updates to a HipChat channel during playbook execution.
@@ -56,7 +57,7 @@ class CallbackModule(CallbackBase):
if not HAS_PRETTYTABLE:
self.disabled = True
- self.display.warning('The `prettytable` python module is not installed. '
+ self._display.warning('The `prettytable` python module is not installed. '
'Disabling the HipChat callback plugin.')
self.msg_uri = 'https://api.hipchat.com/v1/rooms/message'
@@ -67,7 +68,7 @@ class CallbackModule(CallbackBase):
if self.token is None:
self.disabled = True
- self.display.warning('HipChat token could not be loaded. The HipChat '
+ self._display.warning('HipChat token could not be loaded. The HipChat '
'token can be provided using the `HIPCHAT_TOKEN` '
'environment variable.')
@@ -91,8 +92,7 @@ class CallbackModule(CallbackBase):
response = open_url(url, data=urllib.urlencode(params))
return response.read()
except:
- self.display.warning('Could not submit message to hipchat')
-
+ self._display.warning('Could not submit message to hipchat')
def v2_playbook_on_play_start(self, play):
"""Display Playbook and play start messages"""