cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alena1...@apache.org
Subject [46/50] [abbrv] git commit: Enable VpcVirtualRouter when deploying advanced zone
Date Tue, 31 Jul 2012 20:40:03 GMT
Enable VpcVirtualRouter when deploying advanced zone


Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/ed7f72b6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/ed7f72b6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/ed7f72b6

Branch: refs/heads/vpc
Commit: ed7f72b629e4e95db0871ab0c571d0caa48ed34e
Parents: 7662426
Author: Prasanna Santhanam <Prasanna.Santhanam@citrix.com>
Authored: Wed Jul 25 18:51:04 2012 +0530
Committer: Prasanna Santhanam <tsp@apache.org>
Committed: Mon Jul 30 15:32:35 2012 +0530

----------------------------------------------------------------------
 tools/marvin/marvin/deployDataCenter.py |   45 ++++++++++++++++++-------
 1 files changed, 32 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ed7f72b6/tools/marvin/marvin/deployDataCenter.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/deployDataCenter.py b/tools/marvin/marvin/deployDataCenter.py
index 91045cd..bd0217f 100644
--- a/tools/marvin/marvin/deployDataCenter.py
+++ b/tools/marvin/marvin/deployDataCenter.py
@@ -196,26 +196,45 @@ class deployDataCenters():
         vrconfig.id = vrprovid
         vrconfigresponse = \
         self.apiClient.configureVirtualRouterElement(vrconfig)
+        
+        upnetprov = \
+        updateNetworkServiceProvider.updateNetworkServiceProviderCmd()
+        upnetprov.id = vrprov.nspid
+        upnetprov.state = "Enabled"
+        upnetprovresponse = \
+        self.apiClient.updateNetworkServiceProvider(upnetprov)
 
         if zone.networktype == "Basic" and zone.securitygroupenabled:
             sgprovider = configGenerator.provider()
             sgprovider.name = "SecurityGroupProvider"
             zone.providers.append(sgprovider)
-
-        for prov in zone.providers:
-            pnetprov = \
-            listNetworkServiceProviders.listNetworkServiceProvidersCmd()
+            
+        if zone.networktype == "Advanced":
+            pnetprov = listNetworkServiceProviders.listNetworkServiceProvidersCmd()
             pnetprov.physicalnetworkid = phynetwrk.id
-            pnetprov.name = prov.name
             pnetprov.state = "Disabled"
-            pnetprovs = self.apiClient.listNetworkServiceProviders(pnetprov)
-
-            upnetprov = \
-            updateNetworkServiceProvider.updateNetworkServiceProviderCmd()
-            upnetprov.id = pnetprovs[0].id
-            upnetprov.state = "Enabled"
-            upnetprovresponse = \
-            self.apiClient.updateNetworkServiceProvider(upnetprov)
+            pnetprov.name = "VpcVirtualRouter"
+            pnetprovres = self.apiClient.listNetworkServiceProviders(pnetprov)
+            
+            if len(pnetprovres) > 0:
+                vpcvrprov = listVirtualRouterElements.listVirtualRouterElementsCmd()
+                vpcvrprov.nspid = pnetprovres[0].id
+                vpcvrprovresponse = self.apiClient.listVirtualRouterElements(vpcvrprov)
+                vpcvrprovid = vpcvrprovresponse[0].id
+        
+                vpcvrconfig = \
+                configureVirtualRouterElement.configureVirtualRouterElementCmd()
+                vpcvrconfig.enabled = "true"
+                vpcvrconfig.id = vpcvrprovid
+                vpcvrconfigresponse = \
+                self.apiClient.configureVirtualRouterElement(vpcvrconfig)
+                
+                upnetprov = \
+                updateNetworkServiceProvider.updateNetworkServiceProviderCmd()
+                upnetprov.id = vpcvrprov.nspid
+                upnetprov.state = "Enabled"
+                upnetprovresponse = \
+                self.apiClient.updateNetworkServiceProvider(upnetprov)
 
     def addTrafficTypes(self, physical_network_id, traffictypes=None, \
                         network_labels=None):


Mime
View raw message