libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LIBCLOUD-707) CloudSigma driver throws exception when parsing response in list_nodes
Date Wed, 13 May 2015 11:19:59 GMT

    [ https://issues.apache.org/jira/browse/LIBCLOUD-707?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14541741#comment-14541741
] 

ASF GitHub Bot commented on LIBCLOUD-707:
-----------------------------------------

GitHub user chrisob opened a pull request:

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

    [LIBCLOUD-707] Fixed exception when parsing CloudSigma static IPs

    Fixes issue with CloudSigma compute driver: https://issues.apache.org/jira/browse/LIBCLOUD-707

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

    $ git pull https://github.com/chrisob/libcloud LIBCLOUD-707_cloudsigma_response_parsing_fix

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

    https://github.com/apache/libcloud/pull/514.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 #514
    
----
commit 2a48a10f262f18c9e107b050dee464a9bae73886
Author: Chris O'Brien <chrisob91@gmail.com>
Date:   2015-05-13T11:14:07Z

    [LIBCLOUD-707] Fixed exception when parsing CloudSigma static IPs

----


> CloudSigma driver throws exception when parsing response in list_nodes
> ----------------------------------------------------------------------
>
>                 Key: LIBCLOUD-707
>                 URL: https://issues.apache.org/jira/browse/LIBCLOUD-707
>             Project: Libcloud
>          Issue Type: Bug
>          Components: Compute
>    Affects Versions: 0.14.0-beta3, 0.13.3, 0.15.0, 0.15.1
>            Reporter: Chris O'Brien
>
> While attempting to parse the IPs from a node's NICs in CloudSigma's API response, libcloud
throws an exception when the node's IP is static: 
> {noformat}
> TypeError: unhashable type: 'dict'
> File "/home/dbs_support/dev/libcloudsigma/test.py", line 55, in <module>
>   instances = deployer.getInstances()
> File "/home/dbs_support/dev/libcloudsigma/test.py", line 44, in getInstances
>   return self.driver.list_nodes()
> File "/home/dbs_support/lib/libcloud/compute/drivers/cloudsigma.py", line 1026, in list_nodes
>   nodes = [self._to_node(data=item) for item in response['objects']]
> File "/home/dbs_support/lib/libcloud/compute/drivers/cloudsigma.py", line 1910, in _to_node
>   _public_ips, _private_ips = self._parse_ips_from_nic(nic=nic)
> File "/home/dbs_support/lib/libcloud/compute/drivers/cloudsigma.py", line 1888, in _parse_ips_from_nic
>   ips = set(ips)
> {noformat}
> It seems that libcloud doesn't account for CloudSigma's response for static IPs containing
the 'uuid' as a subobject of 'ip' in the 'ip_v4_conf' for a NIC.  
> For example, a NIC with a static IP belonging to a server:
> {noformat}
> {
>     "firewall_policy":null,
>     "boot_order":null,
>     "vlan":null,
>     "ip_v4_conf":{
>         "ip":{
>             "uuid":"178.22.68.44",
>             "resource_uri":"/api/2.0/ips/178.22.68.44/"
>         },
>         "conf":"static"
>     },
>     "mac":"22:9d:42:9d:30:2f",
>     "model":"virtio",
>     "runtime":{
>         "interface_type":"public",
>         "ip_v4":{
>             "uuid":"178.22.68.44",
>             "resource_uri":"/api/2.0/ips/178.22.68.44/"
>         },
>         "io":{
>             "bytes_sent":403849752,
>             "packets_sent":6089897,
>             "bytes_recv":1348149166,
>             "packets_recv":1144445
>         },
>         "ip_v6":null
>     },
>     "ip_v6_conf":null
> }
> {noformat}
> The NIC's {{\['ip_v4_conf'\]\['ip'\]}} object (which is a dict) gets put into a list
(ips) with other strings (representing IPs).  It chokes when attempting to convert this list
containing both dicts and strings into a set.  



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message