You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by "Chris O'Brien (JIRA)" <ji...@apache.org> on 2015/05/18 11:33:00 UTC
[jira] [Closed] (LIBCLOUD-707) CloudSigma driver throws exception
when parsing response in list_nodes
[ https://issues.apache.org/jira/browse/LIBCLOUD-707?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Chris O'Brien closed LIBCLOUD-707.
----------------------------------
Resolution: Fixed
> 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)