Repository: libcloud Updated Branches: refs/heads/trunk 60cbe22bf -> b2caf0f7d
[google compute] fix missing param for ex_add_access_config Closes #435 Signed-off-by: Eric Johnson <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/b2caf0f7 Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/b2caf0f7 Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/b2caf0f7 Branch: refs/heads/trunk Commit: b2caf0f7d399765afc4f8b94f0220b2ca2d5ce5b Parents: 60cbe22 Author: Peter Mooshammer <[email protected]> Authored: Sat Jan 17 16:08:37 2015 -0800 Committer: Eric Johnson <[email protected]> Committed: Wed Jan 21 13:06:03 2015 +0000 ---------------------------------------------------------------------- CHANGES.rst | 4 ++++ libcloud/compute/drivers/gce.py | 8 +++++--- libcloud/test/compute/test_gce.py | 4 ++-- 3 files changed, 11 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/libcloud/blob/b2caf0f7/CHANGES.rst ---------------------------------------------------------------------- diff --git a/CHANGES.rst b/CHANGES.rst index 8be94b3..d5e91ff 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -16,6 +16,10 @@ General Compute ~~~~~~~ +- GCE driver fixed for missing param on ex_add_access_config + (GITHUB-435) + [Peter Mooshammer] + - GCE driver support for HTTP load-balancer resources (LIBCLOUD-605, GITHUB-429) [Lee Verberne] http://git-wip-us.apache.org/repos/asf/libcloud/blob/b2caf0f7/libcloud/compute/drivers/gce.py ---------------------------------------------------------------------- diff --git a/libcloud/compute/drivers/gce.py b/libcloud/compute/drivers/gce.py index b4cdbb4..ab98179 100644 --- a/libcloud/compute/drivers/gce.py +++ b/libcloud/compute/drivers/gce.py @@ -899,7 +899,8 @@ class GCENodeDriver(NodeDriver): else: self.region = None - def ex_add_access_config(self, node, name, nat_ip=None, config_type=None): + def ex_add_access_config(self, node, name, nic, nat_ip=None, + config_type=None): """ Add a network interface access configuration to a node. @@ -934,10 +935,11 @@ class GCENodeDriver(NodeDriver): if nat_ip is not None: config['natIP'] = nat_ip - + params = {'networkInterface': nic} request = '/zones/%s/instances/%s/addAccessConfig' % (zone_name, node_name) - self.connection.async_request(request, method='POST', data=config) + self.connection.async_request(request, method='POST', + data=config, params=params) return True def ex_delete_access_config(self, node, name, nic): http://git-wip-us.apache.org/repos/asf/libcloud/blob/b2caf0f7/libcloud/test/compute/test_gce.py ---------------------------------------------------------------------- diff --git a/libcloud/test/compute/test_gce.py b/libcloud/test/compute/test_gce.py index f9c86e9..e726054 100644 --- a/libcloud/test/compute/test_gce.py +++ b/libcloud/test/compute/test_gce.py @@ -1093,9 +1093,9 @@ class GCENodeDriverTest(LibcloudTestCase, TestCaseMixin): def test_ex_add_access_config(self): self.assertRaises(ValueError, self.driver.ex_add_access_config, - 'node', 'name') + 'node', 'name', 'nic') node = self.driver.ex_get_node('node-name', 'us-central1-a') - self.assertTrue(self.driver.ex_add_access_config(node, 'foo')) + self.assertTrue(self.driver.ex_add_access_config(node, 'foo', 'bar')) def test_ex_delete_access_config(self): self.assertRaises(ValueError, self.driver.ex_add_access_config,
