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 18:29:53 UTC

svn commit: r1081870 - /incubator/libcloud/trunk/libcloud/pricing.py

Author: tomaz
Date: Tue Mar 15 17:29:52 2011
New Revision: 1081870

URL: http://svn.apache.org/viewvc?rev=1081870&view=rev
Log:
Add set_pricing function.

Modified:
    incubator/libcloud/trunk/libcloud/pricing.py

Modified: incubator/libcloud/trunk/libcloud/pricing.py
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/libcloud/pricing.py?rev=1081870&r1=1081869&r2=1081870&view=diff
==============================================================================
--- incubator/libcloud/trunk/libcloud/pricing.py (original)
+++ incubator/libcloud/trunk/libcloud/pricing.py Tue Mar 15 17:29:52 2011
@@ -67,6 +67,22 @@ def get_pricing(driver_type, driver_name
     PRICING_DATA[driver_type][driver_name] = pricing
     return pricing
 
+def set_pricing(driver_type, driver_name, pricing):
+    """
+    Populate the driver pricing dictionary.
+
+    @type driver_type: C{str}
+    @param driver_type: Driver type ('compute' or 'storage')
+
+    @type driver_name: C{str}
+    @param driver_name: Driver name
+
+    @type pricing: C{dict}
+    @param pricing: Dictionary where a key is a size ID and a value is a price.
+    """
+
+    PRICING_DATA[driver_type][driver_name] = pricing
+
 def get_size_price(driver_type, driver_name, size_id):
     """
     Return price for the provided size.