incubator-libcloud mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sengor (JIRA)" <j...@apache.org>
Subject [libcloud] [jira] Resolved: (LIBCLOUD-48) Deprovisioning image state not recognised within drivers/ibm_sbc.py
Date Tue, 31 Aug 2010 08:24:54 GMT

     [ https://issues.apache.org/jira/browse/LIBCLOUD-48?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Sengor resolved LIBCLOUD-48.
----------------------------

    Resolution: Fixed

Fix confirmed working:

>>> from libcloud.types import Provider
>>> from libcloud.providers import get_driver
>>>
>>> driver=get_driver(Provider.IBM)
>>> conn = driver(".....", ".....")
>>> conn.list_nodes()
[<Node: uuid=...., name=test, state=0, public_ip=170.... , provider=IBM Developer Cloud
...>]
>>> conn.destroy_node(conn.list_nodes()[0])
True
>>> conn.list_nodes()
[<Node: uuid=...., name=test, state=3, public_ip=170..... , provider=IBM Developer Cloud
...>]
>>>

> Deprovisioning image state not recognised within drivers/ibm_sbc.py
> -------------------------------------------------------------------
>
>                 Key: LIBCLOUD-48
>                 URL: https://issues.apache.org/jira/browse/LIBCLOUD-48
>             Project: Libcloud
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 0.3.0
>         Environment: Confirmed on both Windows and Linux
>            Reporter: Sengor
>            Priority: Minor
>         Attachments: 100830_ibm_sbc.txt
>
>
> The IBM Dev Cloud driver does not recognise currently undocumented "Deprovisioning" instance
state, form REST API /computecloud/enterprise/api/rest/20100331/instances XML response:
> <ns2:DescribeInstancesResponse xmlns:ns2="http://www.ibm.com/xmlns/b2b/cloud/api/2010-03-31">
> <Instance>
> <ID>
> 19113
> </ID>
> <Location>
> 41
> </Location>
> <RequestID name="test instance">
> 19413
> </RequestID>
> <Name>
> test instance
> </Name>
> <Owner>
> ....
> </Owner>
> <ImageID>
> 20001150
> </ImageID>
> <InstanceType>
> BRZ32.1/2048/175
> </InstanceType>
> <KeyName>
> My Key
> </KeyName>
> <Hostname>
> 170.....
> </Hostname>
> <IP>
> 170....
> </IP>
> <Status>
> 12
> </Status>
> <LaunchTime>
> 2010-08-30T13:27:14.730Z
> </LaunchTime>
> <ExpirationTime>
> 2012-08-28T14:00:00.000Z
> </ExpirationTime>
> <ProductCodes/>
> <Software>
> <Application>
> <Name>
> SUSE Linux Enterprise Server
> </Name>
> <Version>
> 11
> </Version>
> <Type>
> OS
> </Type>
> </Application>
> </Software>
> </Instance>
> </ns2:DescribeInstancesResponse>
> This causes:
> Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit (Intel)] on win32
> Type "help", "copyright", "credits" or "license" for more information.
> >>>
> >>> from libcloud.types import Provider
> >>> from libcloud.providers import get_driver
> >>>
> >>>
> >>> id = "..."
> >>> pw = "..."
> >>>
> >>> Driver = get_driver(Provider.IBM)
> >>> conn = Driver(id, pw)
> >>>
> >>> nodes = conn.list_nodes()
> >>> nodes
> [<Node: uuid=..., name=test instance, state=0, public_ip=...  , provider=IBM Developer
Cloud ...>]
> >>> nodes[0]
> <Node: uuid=..., name=test instance, state=0, public_ip=...  , provider=IBM Developer
Cloud ...>
> >>> conn.destroy_node(nodes[0])
> True
> >>> conn.list_nodes()
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "C:\Python25\Lib\site-packages\libcloud\drivers\ibm_sbc.py", line 138, in list_nodes
>     return self._to_nodes(self.connection.request(REST_BASE + '/instances').object)
>   File "C:\Python25\Lib\site-packages\libcloud\drivers\ibm_sbc.py", line 156, in _to_nodes
>     return [ self._to_node(instance) for instance in object.findall('Instance') ]
>   File "C:\Python25\Lib\site-packages\libcloud\drivers\ibm_sbc.py", line 161, in _to_node
>     state = self.NODE_STATE_MAP[int(instance.findtext('Status'))],
> KeyError: 12
> >>>
> I believe NODE_STATE_MAP within drivers/ibm_sbc.py would need to be updated to reflect
status #12.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message