You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by an...@apache.org on 2016/01/20 04:44:06 UTC
[18/50] libcloud git commit: Tell the Mock HTTP object to use the
method name 'root' when the path contains nothing,
which in every ECS case it does
Tell the Mock HTTP object to use the method name 'root' when the path contains nothing, which in every ECS case it does
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/54737715
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/54737715
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/54737715
Branch: refs/heads/trunk
Commit: 547377153134b94e417fad1705b62c822f475b02
Parents: b64d2fa
Author: anthony-shaw <an...@gmail.com>
Authored: Wed Dec 30 21:41:30 2015 +1100
Committer: anthony-shaw <an...@gmail.com>
Committed: Wed Dec 30 21:41:30 2015 +1100
----------------------------------------------------------------------
libcloud/container/drivers/ecs.py | 6 ++----
libcloud/test/__init__.py | 3 +++
libcloud/test/container/test_ecs.py | 2 +-
3 files changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/54737715/libcloud/container/drivers/ecs.py
----------------------------------------------------------------------
diff --git a/libcloud/container/drivers/ecs.py b/libcloud/container/drivers/ecs.py
index 6485b10..1485027 100644
--- a/libcloud/container/drivers/ecs.py
+++ b/libcloud/container/drivers/ecs.py
@@ -83,13 +83,12 @@ class ElasticContainerDriver(ContainerDriver):
:rtype: :class:`ContainerCluster`
"""
- params = {'Action': 'CreateCluster'}
request = {'clusterName': name}
response = self.connection.request(
ROOT,
method='POST',
data=request,
- headers=self._get_headers(params['Action'])
+ headers=self._get_headers('CreateCluster')
).object
return self._to_cluster(response['cluster'])
@@ -100,13 +99,12 @@ class ElasticContainerDriver(ContainerDriver):
:return: ``True`` if the destroy was successful, otherwise ``False``.
:rtype: ``bool``
"""
- params = {'Action': 'DeleteCluster'}
request = {'cluster': cluster.id}
data = self.connection.request(
ROOT,
method='POST',
data=request,
- headers=self._get_headers(params['Action'])
+ headers=self._get_headers('DeleteCluster')
).object
return data['cluster']['status'] == 'INACTIVE'
http://git-wip-us.apache.org/repos/asf/libcloud/blob/54737715/libcloud/test/__init__.py
----------------------------------------------------------------------
diff --git a/libcloud/test/__init__.py b/libcloud/test/__init__.py
index a168630..efc89c2 100644
--- a/libcloud/test/__init__.py
+++ b/libcloud/test/__init__.py
@@ -123,6 +123,9 @@ class BaseMockHttpObject(object):
param = qs[use_param][0].replace('.', '_').replace('-', '_')
meth_name = '%s_%s' % (meth_name, param)
+ if meth_name == '':
+ meth_name = 'root'
+
return meth_name
http://git-wip-us.apache.org/repos/asf/libcloud/blob/54737715/libcloud/test/container/test_ecs.py
----------------------------------------------------------------------
diff --git a/libcloud/test/container/test_ecs.py b/libcloud/test/container/test_ecs.py
index 1a4af3d..86b715e 100644
--- a/libcloud/test/container/test_ecs.py
+++ b/libcloud/test/container/test_ecs.py
@@ -147,7 +147,7 @@ class ECSMockHttp(MockHttp):
'StopTask': 'stoptask.json'
}
- def _2014_11_13(
+ def root(
self, method, url, body, headers):
target = headers['x-amz-target']
if target is not None: