libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anthonys...@apache.org
Subject [1/2] libcloud git commit: Update DescribeQuotas API in Outscale driver
Date Tue, 27 Dec 2016 08:29:15 GMT
Repository: libcloud
Updated Branches:
  refs/heads/trunk f13933ed7 -> 77b127f3e


Update DescribeQuotas API in Outscale driver

DescribeQuota becomes DescribeQuotas with the new API update.

Signed-off-by: Javier M. Mellid <jmunhoz@igalia.com>
Closes #960


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

Branch: refs/heads/trunk
Commit: 1099aeb33d0cbf641294c6570315c55504e95bf1
Parents: f13933e
Author: Javier M. Mellid <jmunhoz@igalia.com>
Authored: Wed Dec 14 19:38:09 2016 +0100
Committer: Anthony Shaw <anthonyshaw@apache.org>
Committed: Tue Dec 27 19:27:58 2016 +1100

----------------------------------------------------------------------
 libcloud/compute/drivers/ec2.py                 |  6 +--
 .../compute/fixtures/fcu/ex_describe_quota.xml  | 53 --------------------
 .../compute/fixtures/fcu/ex_describe_quotas.xml | 53 ++++++++++++++++++++
 libcloud/test/compute/test_ec2.py               |  8 +--
 4 files changed, 60 insertions(+), 60 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/1099aeb3/libcloud/compute/drivers/ec2.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/ec2.py b/libcloud/compute/drivers/ec2.py
index 26656eb..12e1e1c 100644
--- a/libcloud/compute/drivers/ec2.py
+++ b/libcloud/compute/drivers/ec2.py
@@ -6980,8 +6980,8 @@ class OutscaleNodeDriver(BaseEC2NodeDriver):
 
         return quota
 
-    def ex_describe_quota(self, dry_run=False, filters=None,
-                          max_results=None, marker=None):
+    def ex_describe_quotas(self, dry_run=False, filters=None,
+                           max_results=None, marker=None):
         """
         Describes one or more of your quotas.
 
@@ -7011,7 +7011,7 @@ class OutscaleNodeDriver(BaseEC2NodeDriver):
             raise NotImplementedError(
                 'quota marker is not implemented')
 
-        params = {'Action': 'DescribeQuota'}
+        params = {'Action': 'DescribeQuotas'}
 
         if dry_run:
             params.update({'DryRun': dry_run})

http://git-wip-us.apache.org/repos/asf/libcloud/blob/1099aeb3/libcloud/test/compute/fixtures/fcu/ex_describe_quota.xml
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/fcu/ex_describe_quota.xml b/libcloud/test/compute/fixtures/fcu/ex_describe_quota.xml
deleted file mode 100644
index 2948302..0000000
--- a/libcloud/test/compute/fixtures/fcu/ex_describe_quota.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-<DescribeQuotaResponse
-    xmlns="http://api.outscale.com/wsdl/fcuext/2014-04-15/">
-    <requestId>31ef7689-2521-445f-b634-2a5e3e66f699</requestId>
-    <isTruncated>true</isTruncated>
-    <referenceQuotaSet>
-        <item>
-            <reference>global</reference>
-            <quotaSet>
-                <item>
-                    <ownerId>366866344682</ownerId>
-                    <name>vm_limit</name>
-                    <displayName>VM Limit</displayName>
-                    <description>Maximum number of VM this user can own</description>
-                    <groupName>Compute</groupName>
-                    <maxQuotaValue>20</maxQuotaValue>
-                    <usedQuotaValue>1</usedQuotaValue>
-                </item>
-                <item>
-                    <ownerId>366866344682</ownerId>
-                    <name>core_limit</name>
-                    <displayName>Core Limit</displayName>
-                    <description>Maximum number of total cores (virtual core)</description>
-                    <groupName>Compute</groupName>
-                    <maxQuotaValue>800</maxQuotaValue>
-                    <usedQuotaValue>2</usedQuotaValue>
-                </item>
-                <item>
-                    <ownerId>366866344682</ownerId>
-                    <name>memory_limit</name>
-                    <displayName>Memory Limit</displayName>
-                    <description>Maximum number of total memory (GiB)</description>
-                    <groupName>Compute</groupName>
-                    <maxQuotaValue>4880</maxQuotaValue>
-                    <usedQuotaValue>7</usedQuotaValue>
-                </item>
-            </quotaSet>
-        </item>
-        <item>
-            <reference>vpc-00000000</reference>
-            <quotaSet>
-                <item>
-                    <ownerId>366866344682</ownerId>
-                    <name>sg_limit</name>
-                    <displayName>Security Groups Limit</displayName>
-                    <description>Maximum number of security groups</description>
-                    <groupName>Security Groups</groupName>
-                    <maxQuotaValue>100</maxQuotaValue>
-                    <usedQuotaValue>2</usedQuotaValue>
-                </item>
-            </quotaSet>
-        </item>
-    </referenceQuotaSet>
-</DescribeQuotaResponse>

http://git-wip-us.apache.org/repos/asf/libcloud/blob/1099aeb3/libcloud/test/compute/fixtures/fcu/ex_describe_quotas.xml
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/fcu/ex_describe_quotas.xml b/libcloud/test/compute/fixtures/fcu/ex_describe_quotas.xml
new file mode 100644
index 0000000..a3d2941
--- /dev/null
+++ b/libcloud/test/compute/fixtures/fcu/ex_describe_quotas.xml
@@ -0,0 +1,53 @@
+<DescribeQuotasResponse
+    xmlns="http://api.outscale.com/wsdl/fcuext/2014-04-15/">
+    <requestId>31ef7689-2521-445f-b634-2a5e3e66f699</requestId>
+    <isTruncated>true</isTruncated>
+    <referenceQuotaSet>
+        <item>
+            <reference>global</reference>
+            <quotaSet>
+                <item>
+                    <ownerId>366866344682</ownerId>
+                    <name>vm_limit</name>
+                    <displayName>VM Limit</displayName>
+                    <description>Maximum number of VM this user can own</description>
+                    <groupName>Compute</groupName>
+                    <maxQuotaValue>20</maxQuotaValue>
+                    <usedQuotaValue>1</usedQuotaValue>
+                </item>
+                <item>
+                    <ownerId>366866344682</ownerId>
+                    <name>core_limit</name>
+                    <displayName>Core Limit</displayName>
+                    <description>Maximum number of total cores (virtual core)</description>
+                    <groupName>Compute</groupName>
+                    <maxQuotaValue>800</maxQuotaValue>
+                    <usedQuotaValue>2</usedQuotaValue>
+                </item>
+                <item>
+                    <ownerId>366866344682</ownerId>
+                    <name>memory_limit</name>
+                    <displayName>Memory Limit</displayName>
+                    <description>Maximum number of total memory (GiB)</description>
+                    <groupName>Compute</groupName>
+                    <maxQuotaValue>4880</maxQuotaValue>
+                    <usedQuotaValue>7</usedQuotaValue>
+                </item>
+            </quotaSet>
+        </item>
+        <item>
+            <reference>vpc-00000000</reference>
+            <quotaSet>
+                <item>
+                    <ownerId>366866344682</ownerId>
+                    <name>sg_limit</name>
+                    <displayName>Security Groups Limit</displayName>
+                    <description>Maximum number of security groups</description>
+                    <groupName>Security Groups</groupName>
+                    <maxQuotaValue>100</maxQuotaValue>
+                    <usedQuotaValue>2</usedQuotaValue>
+                </item>
+            </quotaSet>
+        </item>
+    </referenceQuotaSet>
+</DescribeQuotasResponse>

http://git-wip-us.apache.org/repos/asf/libcloud/blob/1099aeb3/libcloud/test/compute/test_ec2.py
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/test_ec2.py b/libcloud/test/compute/test_ec2.py
index aceb05b..b892f5b 100644
--- a/libcloud/test/compute/test_ec2.py
+++ b/libcloud/test/compute/test_ec2.py
@@ -1800,8 +1800,8 @@ class OutscaleTests(EC2Tests):
 class FCUMockHttp(EC2MockHttp):
     fixtures = ComputeFileFixtures('fcu')
 
-    def _DescribeQuota(self, method, url, body, headers):
-        body = self.fixtures.load('ex_describe_quota.xml')
+    def _DescribeQuotas(self, method, url, body, headers):
+        body = self.fixtures.load('ex_describe_quotas.xml')
         return (httplib.OK, body, {}, httplib.responses[httplib.OK])
 
     def _DescribeProductTypes(self, method, url, body, headers):
@@ -1831,8 +1831,8 @@ class OutscaleFCUTests(LibcloudTestCase):
                                             secret=EC2_PARAMS[1],
                                             host='some.fcucloud.com')
 
-    def test_ex_describe_quota(self):
-        is_truncated, quota = self.driver.ex_describe_quota()
+    def test_ex_describe_quotas(self):
+        is_truncated, quota = self.driver.ex_describe_quotas()
         self.assertTrue(is_truncated == 'true')
         self.assertTrue('global' in quota.keys())
         self.assertTrue('vpc-00000000' in quota.keys())


Mime
View raw message