libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject git commit: Update Linode pricing.
Date Sat, 26 Apr 2014 15:24:12 GMT
Repository: libcloud
Updated Branches:
  refs/heads/trunk 48d3bfd31 -> 587092512


Update Linode pricing.

Closes #281

Signed-off-by: Tomaz Muraus <tomaz@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/58709251
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/58709251
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/58709251

Branch: refs/heads/trunk
Commit: 5870925123b7738f976f7b56d198e97f210bba8d
Parents: 48d3bfd
Author: Jon Chen <bsd@voltaire.sh>
Authored: Fri Apr 25 19:02:51 2014 -0400
Committer: Tomaz Muraus <tomaz@apache.org>
Committed: Sat Apr 26 17:19:54 2014 +0200

----------------------------------------------------------------------
 libcloud/common/linode.py                       |  18 +-
 .../fixtures/linode/_avail_linodeplans.json     | 257 +++++++++----------
 .../compute/fixtures/linode/_linode_list.json   |   6 +-
 libcloud/test/compute/test_linode.py            |   2 +-
 4 files changed, 137 insertions(+), 146 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/58709251/libcloud/common/linode.py
----------------------------------------------------------------------
diff --git a/libcloud/common/linode.py b/libcloud/common/linode.py
index 9d953f0..f7ee22b 100644
--- a/libcloud/common/linode.py
+++ b/libcloud/common/linode.py
@@ -31,15 +31,15 @@ __all__ = [
 API_HOST = 'api.linode.com'
 API_ROOT = '/'
 
-# Constants that map a RAM figure to a PlanID (updated 6/28/10)
-LINODE_PLAN_IDS = {1024: '1',
-                   2048: '3',
-                   4096: '5',
-                   8192: '6',
-                   16384: '7',
-                   24576: '8',
-                   32768: '9',
-                   40960: '10'}
+# Constants that map a RAM figure to a PlanID (updated 4/25/14)
+LINODE_PLAN_IDS = {2048: '1',
+                   4096: '3',
+                   8192: '5',
+                   16384: '6',
+                   32768: '7',
+                   49152: '8',
+                   65536: '9',
+                   98304: '11'}
 
 
 class LinodeException(Exception):

http://git-wip-us.apache.org/repos/asf/libcloud/blob/58709251/libcloud/test/compute/fixtures/linode/_avail_linodeplans.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/linode/_avail_linodeplans.json b/libcloud/test/compute/fixtures/linode/_avail_linodeplans.json
index 4248425..c492e62 100644
--- a/libcloud/test/compute/fixtures/linode/_avail_linodeplans.json
+++ b/libcloud/test/compute/fixtures/linode/_avail_linodeplans.json
@@ -1,134 +1,125 @@
 {
-  "ERRORARRAY": [],
-  "DATA": [
-    {
-      "PRICE": 20,
-      "RAM": 1024,
-      "XFER": 2000,
-      "PLANID": 1,
-      "LABEL": "Linode 1024",
-      "AVAIL": {
-        "2": 500,
-        "3": 500,
-        "4": 500,
-        "6": 500,
-        "7": 500,
-        "8": 500
-      },
-      "DISK": 48
-    },
-    {
-      "PRICE": 40,
-      "RAM": 2048,
-      "XFER": 4000,
-      "PLANID": 3,
-      "LABEL": "Linode 2048",
-      "AVAIL": {
-        "2": 500,
-        "3": 500,
-        "4": 500,
-        "6": 500,
-        "7": 500,
-        "8": 500
-      },
-      "DISK": 96
-    },
-    {
-      "PRICE": 80,
-      "RAM": 4096,
-      "XFER": 8000,
-      "PLANID": 5,
-      "LABEL": "Linode 4096",
-      "AVAIL": {
-        "2": 500,
-        "3": 500,
-        "4": 500,
-        "6": 500,
-        "7": 500,
-        "8": 500
-      },
-      "DISK": 192
-    },
-    {
-      "PRICE": 160,
-      "RAM": 8192,
-      "XFER": 16000,
-      "PLANID": 6,
-      "LABEL": "Linode 8192",
-      "AVAIL": {
-        "2": 500,
-        "3": 500,
-        "4": 500,
-        "6": 500,
-        "7": 500,
-        "8": 500
-      },
-      "DISK": 384
-    },
-    {
-      "PRICE": 320,
-      "RAM": 16384,
-      "XFER": 20000,
-      "PLANID": 7,
-      "LABEL": "Linode 16384",
-      "AVAIL": {
-        "2": 500,
-        "3": 500,
-        "4": 500,
-        "6": 500,
-        "7": 500,
-        "8": 500
-      },
-      "DISK": 768
-    },
-    {
-      "PRICE": 480,
-      "RAM": 24576,
-      "XFER": 20000,
-      "PLANID": 8,
-      "LABEL": "Linode 24576",
-      "AVAIL": {
-        "2": 500,
-        "3": 500,
-        "4": 500,
-        "6": 500,
-        "7": 500,
-        "8": 500
-      },
-      "DISK": 1152
-    },
-    {
-      "PRICE": 640,
-      "RAM": 32768,
-      "XFER": 20000,
-      "PLANID": 9,
-      "LABEL": "Linode 32768",
-      "AVAIL": {
-        "2": 500,
-        "3": 500,
-        "4": 500,
-        "6": 500,
-        "7": 500,
-        "8": 500
-      },
-      "DISK": 1536
-    },
-    {
-      "PRICE": 800,
-      "RAM": 40960,
-      "XFER": 20000,
-      "PLANID": 10,
-      "LABEL": "Linode 40960",
-      "AVAIL": {
-        "2": 500,
-        "3": 500,
-        "4": 500,
-        "6": 500,
-        "7": 500,
-        "8": 500
-      },
-      "DISK": 1920
-    }
-  ],
-  "ACTION": "avail.linodeplans"
-}
\ No newline at end of file
+    "ERRORARRAY": [],
+    "DATA": [{
+        "PRICE": 20.00,
+        "RAM": 2048,
+        "XFER": 3000,
+        "PLANID": 1,
+        "LABEL": "Linode 2048",
+        "AVAIL": {
+            "3": 500,
+            "2": 500,
+            "7": 500,
+            "6": 500,
+            "4": 500,
+            "8": 500
+        },
+        "DISK": 48
+    }, {
+        "PRICE": 40.00,
+        "RAM": 4096,
+        "XFER": 4000,
+        "PLANID": 3,
+        "LABEL": "Linode 4096",
+        "AVAIL": {
+            "3": 500,
+            "2": 500,
+            "7": 500,
+            "6": 500,
+            "4": 500,
+            "8": 500
+        },
+        "DISK": 96
+    }, {
+        "PRICE": 80.00,
+        "RAM": 8192,
+        "XFER": 8000,
+        "PLANID": 5,
+        "LABEL": "Linode 8192",
+        "AVAIL": {
+            "3": 500,
+            "2": 500,
+            "7": 500,
+            "6": 500,
+            "4": 500,
+            "8": 500
+        },
+        "DISK": 192
+    }, {
+        "PRICE": 160.00,
+        "RAM": 16384,
+        "XFER": 16000,
+        "PLANID": 6,
+        "LABEL": "Linode 16384",
+        "AVAIL": {
+            "3": 500,
+            "2": 500,
+            "7": 500,
+            "6": 500,
+            "4": 500,
+            "8": 500
+        },
+        "DISK": 384
+    }, {
+        "PRICE": 320.00,
+        "RAM": 32768,
+        "XFER": 20000,
+        "PLANID": 7,
+        "LABEL": "Linode 32768",
+        "AVAIL": {
+            "3": 500,
+            "2": 500,
+            "7": 500,
+            "6": 500,
+            "4": 500,
+            "8": 500
+        },
+        "DISK": 768
+    }, {
+        "PRICE": 480.00,
+        "RAM": 49152,
+        "XFER": 20000,
+        "PLANID": 8,
+        "LABEL": "Linode 49152",
+        "AVAIL": {
+            "3": 500,
+            "2": 500,
+            "7": 500,
+            "6": 500,
+            "4": 500,
+            "8": 500
+        },
+        "DISK": 1152
+    }, {
+        "PRICE": 640.00,
+        "RAM": 65536,
+        "XFER": 20000,
+        "PLANID": 9,
+        "LABEL": "Linode 65536",
+        "AVAIL": {
+            "3": 500,
+            "2": 500,
+            "7": 500,
+            "6": 500,
+            "4": 500,
+            "8": 500
+        },
+        "DISK": 1536
+    }, {
+        "PRICE": 960.00,
+        "RAM": 98304,
+        "XFER": 20000,
+        "PLANID": 11,
+        "LABEL": "Linode 98304",
+        "AVAIL": {
+            "3": 500,
+            "2": 500,
+            "7": 500,
+            "6": 500,
+            "4": 500,
+            "8": 500
+        },
+        "DISK": 1920
+    }],
+    "ACTION": "avail.linodeplans"
+}

http://git-wip-us.apache.org/repos/asf/libcloud/blob/58709251/libcloud/test/compute/fixtures/linode/_linode_list.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/linode/_linode_list.json b/libcloud/test/compute/fixtures/linode/_linode_list.json
index 4f21714..4baf897 100644
--- a/libcloud/test/compute/fixtures/linode/_linode_list.json
+++ b/libcloud/test/compute/fixtures/linode/_linode_list.json
@@ -13,7 +13,7 @@
       "STATUS": 1,
       "ALERT_DISKIO_ENABLED": 1,
       "CREATE_DT": "2012-05-04 19:31:30.0",
-      "TOTALHD": 98304,
+      "TOTALHD": 49152,
       "ALERT_BWQUOTA_THRESHOLD": 80,
       "TOTALRAM": 2048,
       "ALERT_BWIN_THRESHOLD": 5,
@@ -22,11 +22,11 @@
       "ALERT_BWOUT_ENABLED": 1,
       "BACKUPSENABLED": 1,
       "ALERT_CPU_THRESHOLD": 90,
-      "PLANID": "3",
+      "PLANID": "1",
       "BACKUPWEEKLYDAY": 0,
       "LABEL": "api-node3",
       "LPM_DISPLAYGROUP": "test",
-      "TOTALXFER": 4000
+      "TOTALXFER": 3000
     }
   ],
   "ACTION": "linode.list"

http://git-wip-us.apache.org/repos/asf/libcloud/blob/58709251/libcloud/test/compute/test_linode.py
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/test_linode.py b/libcloud/test/compute/test_linode.py
index b332878..4c7c80f 100644
--- a/libcloud/test/compute/test_linode.py
+++ b/libcloud/test/compute/test_linode.py
@@ -43,7 +43,7 @@ class LinodeTest(unittest.TestCase, TestCaseMixin):
         node = nodes[0]
         self.assertEqual(node.id, "8098")
         self.assertEqual(node.name, 'api-node3')
-        self.assertEqual(node.extra['PLANID'], '3')
+        self.assertEqual(node.extra['PLANID'], '1')
         self.assertTrue('75.127.96.245' in node.public_ips)
         self.assertEqual(node.private_ips, [])
 


Mime
View raw message