Skip to content

Fix XML request formatting for group targets - #14

Merged
posborne merged 1 commit into
digidotcom:masterfrom
ctrlaltdel:master
Nov 13, 2015
Merged

Fix XML request formatting for group targets#14
posborne merged 1 commit into
digidotcom:masterfrom
ctrlaltdel:master

Conversation

@ctrlaltdel

Copy link
Copy Markdown
Contributor

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 "&lt;/group&gt;". Nested exception: The element type "group" must be terminated by the matching end-tag "&lt;/group&gt;".</error></sci_reply>

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 "&lt;/group&gt;". Nested exception: The element type "group" must be terminated by the matching end-tag "&lt;/group&gt;".</error></sci_reply>
@posborne

Copy link
Copy Markdown
Contributor

Thanks for the fix and adding a test that catches the bug!

@posborne
posborne merged commit 30bab3c into digidotcom:master Nov 13, 2015
@posborne

Copy link
Copy Markdown
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

@ctrlaltdel

Copy link
Copy Markdown
Contributor Author

@posborne Great! Thanks for the release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants