You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by konstan <gi...@git.apache.org> on 2015/07/29 10:48:52 UTC

[GitHub] libcloud pull request: CloudStack: fix in parsing of an empty body

GitHub user konstan opened a pull request:

    https://github.com/apache/libcloud/pull/555

    CloudStack: fix in parsing of an empty body

    Fix for the issue when `AttributeError: 'str' object has no attribute 'values'` gets thrown in case of an empty body is retuned by the provider.
    ```
    Traceback (most recent call last):
    ...
      File "/usr/lib/python2.6/site-packages/libcloud/compute/drivers/cloudstack.py", line 1089, in list_sizes
        method='GET')
      File "/usr/lib/python2.6/site-packages/libcloud/common/cloudstack.py", line 188, in _sync_request
        headers=headers, method=method)
      File "/usr/lib/python2.6/site-packages/libcloud/common/cloudstack.py", line 152, in _sync_request
        data=data, headers=headers, method=method)
      File "/usr/lib/python2.6/site-packages/libcloud/common/base.py", line 736, in request
        response = responseCls(**kwargs)
      File "/usr/lib/python2.6/site-packages/libcloud/common/base.py", line 117, in __init__
        raise Exception(self.parse_error())
      File "/usr/lib/python2.6/site-packages/libcloud/common/cloudstack.py", line 39, in parse_error
        values = list(body.values())[0]
    AttributeError: 'str' object has no attribute 'values'
    ```
    
    Exception after the change:
    ```
      File "/usr/lib/python2.6/site-packages/libcloud/common/cloudstack.py", line 188, in _sync_request
        headers=headers, method=method)
      File "/usr/lib/python2.6/site-packages/libcloud/common/cloudstack.py", line 152, in _sync_request
        data=data, headers=headers, method=method)
      File "/usr/lib/python2.6/site-packages/libcloud/common/base.py", line 736, in request
        response = responseCls(**kwargs)
      File "/usr/lib/python2.6/site-packages/libcloud/common/base.py", line 117, in __init__
        raise Exception(self.parse_error())
      File "/usr/lib/python2.6/site-packages/libcloud/common/cloudstack.py", line 48, in parse_error
        raise error
    libcloud.common.types.ProviderError: ''
    ```

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/konstan/libcloud trunk

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/libcloud/pull/555.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #555
    
----
commit 9900b9a8ea275a25e18d2af77ae281aa74560556
Author: Konstantin Skaburskas <ko...@gmail.com>
Date:   2015-07-29T08:39:22Z

    CloudStack: fix in parsing an emtpy body.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] libcloud pull request: CloudStack: fix in parsing of an empty body

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/libcloud/pull/555


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---