Fix XML request formatting for group targets - #14
Merged
Conversation
Without this patch, the following error message was received from the Device
Cloud endpoint because of incorrect XML formatting.
Traceback (most recent call last):
File "./digicloud.py", line 137, in <module>
stats(get_targets())
File "./digicloud.py", line 43, in stats
req = dc.sci.send_sci(operation='send_message', target=target, payload=STATS_PAYLOAD)
File "/usr/local/lib/python2.7/dist-packages/devicecloud/sci.py", line 220, in send_sci
return self._conn.post("/ws/sci", full_request)
File "/usr/local/lib/python2.7/dist-packages/devicecloud/__init__.py", line 287, in post
return self._make_request("POST", url, data=data, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/devicecloud/__init__.py", line 178, in _make_request
raise DeviceCloudHttpException(response, err)
devicecloud.DeviceCloudHttpException: HTTP Status 400: <sci_reply version="1.0"><error>Failure to parse SCI request Error on line 1 of document : The element type "group" must be terminated by the matching end-tag "</group>". Nested exception: The element type "group" must be terminated by the matching end-tag "</group>".</error></sci_reply>
Contributor
|
Thanks for the fix and adding a test that catches the bug! |
Contributor
|
Hi @ctrlaltdel. I went ahead and tagged a 0.4.1 version with your fix, so you should be able to use the updated package from pypi if you like. https://github.com/digidotcom/python-devicecloud/blob/master/CHANGELOG.md |
Contributor
Author
|
@posborne Great! Thanks for the release. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Without this patch, the following error message was received from the Device
Cloud endpoint because of incorrect XML formatting.