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 2017/04/21 05:45:13 UTC
[02/14] libcloud git commit: Modify for CI test
Modify for CI test
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/cc5921b7
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/cc5921b7
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/cc5921b7
Branch: refs/heads/trunk
Commit: cc5921b7be12f27c8023bd520572c2a08a665139
Parents: 0acf45e
Author: Jie Ren <sn...@126.com>
Authored: Wed Feb 22 10:53:29 2017 +0800
Committer: Jie Ren <sn...@126.com>
Committed: Wed Feb 22 10:53:29 2017 +0800
----------------------------------------------------------------------
libcloud/compute/drivers/ecs.py | 19 +++++++++++--------
libcloud/test/compute/test_ecs.py | 6 ++++--
2 files changed, 15 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/cc5921b7/libcloud/compute/drivers/ecs.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/ecs.py b/libcloud/compute/drivers/ecs.py
index 744b5ce..3f12bfd 100644
--- a/libcloud/compute/drivers/ecs.py
+++ b/libcloud/compute/drivers/ecs.py
@@ -879,7 +879,7 @@ class ECSDriver(NodeDriver):
:param node: The node to join security group
:type node: :class:`Node`
- :keyword group_id: security group id.
+ :param group_id: security group id.
:type ex_filters: ``str``
@@ -894,8 +894,10 @@ class ECSDriver(NodeDriver):
raise LibcloudError('could not find the node with id %s.'
% node.id)
current = nodes[0]
- if current.state != NodeState.RUNNING and current.state != NodeState.STOPPED:
- raise LibcloudError('The node state with id %s need be running or stopped .' % node.id)
+ if (current.state != NodeState.RUNNING) and \
+ (current.state != NodeState.STOPPED):
+ raise LibcloudError('The node state with id % s need\
+ be running or stopped .' % node.id)
params = {'Action': 'JoinSecurityGroup',
'InstanceId': current.id,
@@ -910,7 +912,7 @@ class ECSDriver(NodeDriver):
:param node: The node to leave security group
:type node: :class:`Node`
- :keyword group_id: security group id.
+ :param group_id: security group id.
:type ex_filters: ``str``
@@ -923,9 +925,10 @@ class ECSDriver(NodeDriver):
raise LibcloudError('could not find the node with id %s.'
% node.id)
current = nodes[0]
- if current.state != NodeState.RUNNING and current.state != NodeState.STOPPED:
- raise LibcloudError('The node with id %s could not join security group, node need be running or stopped .'
- % node.id)
+ if (current.state != NodeState.RUNNING) and \
+ (current.state != NodeState.STOPPED):
+ raise LibcloudError('The node state with id %s need \
+ be running or stopped .' % node.id)
params = {'Action': 'LeaveSecurityGroup',
'InstanceId': node.id,
@@ -952,7 +955,7 @@ class ECSDriver(NodeDriver):
zone_elements = findall(resp_body, 'Zones/Zone',
namespace=self.namespace)
zones = [self._to_zone(el) for el in zone_elements]
- return zones
+ return zones
##
# Volume and snapshot management methods
##
http://git-wip-us.apache.org/repos/asf/libcloud/blob/cc5921b7/libcloud/test/compute/test_ecs.py
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/test_ecs.py b/libcloud/test/compute/test_ecs.py
index ef1b950..a31dc1a 100644
--- a/libcloud/test/compute/test_ecs.py
+++ b/libcloud/test/compute/test_ecs.py
@@ -529,11 +529,13 @@ class ECSDriverTestCase(LibcloudTestCase):
self.assertEqual('2015-06-26T08:35:30Z', sg.creation_time)
def test_ex_join_security_group(self):
- result = self.driver.ex_join_security_group(self.fake_node, ex_security_group_id='F876FF7BA984')
+ ex_security_group_id_value='F876FF7BA984'
+ result = self.driver.ex_join_security_group(self.fake_node, ex_security_group_id=ex_security_group_id_value)
self.assertTrue(result)
def test_ex_leave_security_group(self):
- result = self.driver.ex_leave_security_group(self.fake_node, ex_security_group_id='F876FF7BA984')
+ ex_security_group_id_value='F876FF7BA984'
+ result = self.driver.ex_leave_security_group(self.fake_node, ex_security_group_id=ex_security_group_id_value)
self.assertTrue(result)
def test_ex_list_security_groups_with_ex_filters(self):