Repository: libcloud
Updated Branches:
  refs/heads/trunk 5a9bf7c96 -> 717f7bba7


Fixes the VPC lookup for CloudStackVpnGateway

Signed-off-by: Sebastien Goasguen <[email protected]>

This closes #506


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

Branch: refs/heads/trunk
Commit: 717f7bba76782e5df7617730d161f6ca4e21454c
Parents: 5a9bf7c
Author: Avi Nanhkoesingh <[email protected]>
Authored: Thu Apr 16 10:26:33 2015 +0200
Committer: Sebastien Goasguen <[email protected]>
Committed: Tue Apr 28 13:58:10 2015 +0200

----------------------------------------------------------------------
 CHANGES.rst                            | 4 ++++
 libcloud/compute/drivers/cloudstack.py | 8 ++++----
 2 files changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/717f7bba/CHANGES.rst
----------------------------------------------------------------------
diff --git a/CHANGES.rst b/CHANGES.rst
index 8e8ef4e..d241f32 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -149,6 +149,10 @@ Compute
   (LIBCLOUD-556, GITHUB-305, GITHUB-499)
   [Michael Bennett, davidcrossland, Richard Conway, Matt Baldwin, Tomaz Muraus]
 
+- Fix VPC lookup method in CloudStack driver
+  (GITHUB-506)
+  [Avi Nanhkoesingh]
+
 Storage
 ~~~~~~~
 

http://git-wip-us.apache.org/repos/asf/libcloud/blob/717f7bba/libcloud/compute/drivers/cloudstack.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/cloudstack.py 
b/libcloud/compute/drivers/cloudstack.py
index 22762b3..db89f27 100644
--- a/libcloud/compute/drivers/cloudstack.py
+++ b/libcloud/compute/drivers/cloudstack.py
@@ -964,11 +964,11 @@ class CloudStackVpnGateway(object):
 
     @property
     def vpc(self):
-        for vpc in self.ex_list_vpcs():
+        for vpc in self.driver.ex_list_vpcs():
             if self.vpc_id == vpc.id:
-                break
-        else:
-            raise LibcloudError('VPC with id=%s not found' % self.vpc_id)
+                return vpc
+
+        raise LibcloudError('VPC with id=%s not found' % self.vpc_id)
 
     def delete(self):
         return self.driver.ex_delete_vpn_gateway(vpn_gateway=self)

Reply via email to