Merge pull request #423 from JeanFred/hipchat-checkmode
Add check_mode support to HipChat module
This commit is contained in:
commit
a9910c7de5
1 changed files with 7 additions and 2 deletions
|
@ -96,6 +96,11 @@ def send_msg(module, token, room, msg_from, msg, msg_format='text',
|
|||
|
||||
url = api + "?auth_token=%s" % (token)
|
||||
data = urllib.urlencode(params)
|
||||
|
||||
if module.check_mode:
|
||||
# In check mode, exit before actually sending the message
|
||||
module.exit_json(changed=False)
|
||||
|
||||
response, info = fetch_url(module, url, data=data)
|
||||
if info['status'] == 200:
|
||||
return response.read()
|
||||
|
|
Loading…
Add table
Reference in a new issue