Created
October 4, 2016 02:39
-
-
Save cestinger/314556ae9195fed51b6dfc3fdefe4614 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
We use hipchat to post messages out of hipchat. One thing we noticed is that we were consistently getting an error even though messages were posting correctly. | |
After a little research, we found that we were getting back a 204 from the api call. A 204 indicates that the request has been fulfilled and that there is no additional content to send in the response payload body - https://httpstatuses.com/204. | |
In our case, this is a valid return for this type of traffic - so looking at the hipchat.py script in modules, you can see that a false is purposefully being returned when no content is returned: | |
if result.get('status', None) == salt.ext.six.moves.http_client.OK: | |
response = hipchat_functions.get(api_version).get(function).get('response') | |
return result.get('dict', {}).get(response, None) | |
elif result.get('status', None) == salt.ext.six.moves.http_client.NO_CONTENT: | |
return False | |
else: | |
log.debug(url) | |
log.debug(query_params) | |
log.debug(data) | |
log.debug(result) | |
if result.get('error'): | |
log.error(result) | |
return False | |
By simply changing the False to a True - you can get rid of the error messages if you wish. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment