Updated Branches:
  refs/heads/trunk b6f0ce88e -> 7fc910a88

Adding/Removing instances from targetpool requires a list. This fixes a bug 
with attaching/detaching nodes from loadbalancers. (Attach/Detach wasn't 
working)

Closes #228.

Signed-off-by: Tomaz Muraus <[email protected]>


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

Branch: refs/heads/trunk
Commit: 58f3722ba54dc79cc9ef40271f6a3d39d6e8841d
Parents: b6f0ce8
Author: Rick Wright <[email protected]>
Authored: Tue Jan 21 11:43:01 2014 -0800
Committer: Tomaz Muraus <[email protected]>
Committed: Tue Jan 21 21:08:32 2014 +0100

----------------------------------------------------------------------
 libcloud/compute/drivers/gce.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/58f3722b/libcloud/compute/drivers/gce.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/gce.py b/libcloud/compute/drivers/gce.py
index 93fd2da..84bf7a2 100644
--- a/libcloud/compute/drivers/gce.py
+++ b/libcloud/compute/drivers/gce.py
@@ -1517,7 +1517,7 @@ class GCENodeDriver(NodeDriver):
         if not hasattr(node, 'name'):
             node = self.ex_get_node(node, 'all')
 
-        targetpool_data = {'instance': node.extra['selfLink']}
+        targetpool_data = {'instances': [{'instance': node.extra['selfLink']}]}
 
         request = '/regions/%s/targetPools/%s/addInstance' % (
             targetpool.region.name, targetpool.name)
@@ -1571,7 +1571,7 @@ class GCENodeDriver(NodeDriver):
         if not hasattr(node, 'name'):
             node = self.ex_get_node(node, 'all')
 
-        targetpool_data = {'instance': node.extra['selfLink']}
+        targetpool_data = {'instances': [{'instance': node.extra['selfLink']}]}
 
         request = '/regions/%s/targetPools/%s/removeInstance' % (
             targetpool.region.name, targetpool.name)

Reply via email to