mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 05:10:22 -07:00
Use correct variable name.
This commit is contained in:
parent
c6391741a2
commit
236b2d5c0d
1 changed files with 6 additions and 10 deletions
|
@ -71,10 +71,10 @@ EXAMPLES = '''
|
||||||
|
|
||||||
# Use Hipchat API version 2
|
# Use Hipchat API version 2
|
||||||
|
|
||||||
- hipchat:
|
- hipchat:
|
||||||
api: "https://api.hipchat.com/v2/"
|
api: "https://api.hipchat.com/v2/"
|
||||||
token: OAUTH2_TOKEN
|
token: OAUTH2_TOKEN
|
||||||
room: notify
|
room: notify
|
||||||
msg: "Ansible task finished"
|
msg: "Ansible task finished"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
@ -96,13 +96,9 @@ def send_msg(module, token, room, msg_from, msg, msg_format='text',
|
||||||
params['message_format'] = msg_format
|
params['message_format'] = msg_format
|
||||||
params['color'] = color
|
params['color'] = color
|
||||||
params['api'] = api
|
params['api'] = api
|
||||||
|
params['notify'] = int(notify)
|
||||||
|
|
||||||
if notify:
|
url = api + MSG_URI_V1 + "?auth_token=%s" % (token)
|
||||||
params['notify'] = 1
|
|
||||||
else:
|
|
||||||
params['notify'] = 0
|
|
||||||
|
|
||||||
url = api + "?auth_token=%s" % (token)
|
|
||||||
data = urllib.urlencode(params)
|
data = urllib.urlencode(params)
|
||||||
|
|
||||||
if module.check_mode:
|
if module.check_mode:
|
||||||
|
@ -127,10 +123,10 @@ def send_msg_v2(module, token, room, msg_from, msg, msg_format='text',
|
||||||
body['message'] = msg
|
body['message'] = msg
|
||||||
body['color'] = color
|
body['color'] = color
|
||||||
body['message_format'] = msg_format
|
body['message_format'] = msg_format
|
||||||
params['notify'] = notify
|
body['notify'] = notify
|
||||||
|
|
||||||
POST_URL = api + NOTIFY_URI_V2
|
POST_URL = api + NOTIFY_URI_V2
|
||||||
|
|
||||||
url = POST_URL.replace('{id_or_name}', room)
|
url = POST_URL.replace('{id_or_name}', room)
|
||||||
data = json.dumps(body)
|
data = json.dumps(body)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue