Skip to content

Instantly share code, notes, and snippets.

View guillermo-menjivar's full-sized avatar

gmo guillermo-menjivar

View GitHub Profile
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: