You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by to...@apache.org on 2011/03/15 17:49:29 UTC
svn commit: r1081849 - in /incubator/libcloud/trunk:
libcloud/compute/drivers/rackspace.py test/compute/test_rackspace.py
Author: tomaz
Date: Tue Mar 15 16:49:28 2011
New Revision: 1081849
URL: http://svn.apache.org/viewvc?rev=1081849&view=rev
Log:
Use _get_size_price method in the rackspace driver.
Modified:
incubator/libcloud/trunk/libcloud/compute/drivers/rackspace.py
incubator/libcloud/trunk/test/compute/test_rackspace.py
Modified: incubator/libcloud/trunk/libcloud/compute/drivers/rackspace.py
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/libcloud/compute/drivers/rackspace.py?rev=1081849&r1=1081848&r2=1081849&view=diff
==============================================================================
--- incubator/libcloud/trunk/libcloud/compute/drivers/rackspace.py (original)
+++ incubator/libcloud/trunk/libcloud/compute/drivers/rackspace.py Tue Mar 15 16:49:28 2011
@@ -132,6 +132,7 @@ class RackspaceNodeDriver(NodeDriver):
"""
connectionCls = RackspaceConnection
type = Provider.RACKSPACE
+ api_name = 'rackspace'
name = 'Rackspace'
_rackspace_prices = get_pricing(driver_type='compute',
@@ -437,7 +438,7 @@ class RackspaceNodeDriver(NodeDriver):
ram=int(el.get('ram')),
disk=int(el.get('disk')),
bandwidth=None, # XXX: needs hardcode
- price=self._rackspace_prices.get(el.get('id')), # Hardcoded,
+ price=self._get_size_price(el.get('id')), # Hardcoded,
driver=self.connection.driver)
return s
Modified: incubator/libcloud/trunk/test/compute/test_rackspace.py
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/test/compute/test_rackspace.py?rev=1081849&r1=1081848&r2=1081849&view=diff
==============================================================================
--- incubator/libcloud/trunk/test/compute/test_rackspace.py (original)
+++ incubator/libcloud/trunk/test/compute/test_rackspace.py Tue Mar 15 16:49:28 2011
@@ -68,6 +68,7 @@ class RackspaceTests(unittest.TestCase,
self.assertEqual(len(ret), 7)
size = ret[0]
self.assertEqual(size.name, '256 slice')
+ self.assertTrue(isinstance(size.price, float))
def test_list_images(self):
ret = self.driver.list_images()