cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject [01/45] git commit: updated refs/heads/master to 44ba14d
Date Tue, 25 Aug 2015 18:49:25 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master 2772e4da8 -> 44ba14d17


Create Nicira NVP devices and enable plugin at deploy


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

Branch: refs/heads/master
Commit: abb824e3db0625b435fa55b49496e41efbcbc894
Parents: 2772e4d
Author: Miguel Ferreira <miguelferreira@me.com>
Authored: Wed Aug 5 16:03:28 2015 +0200
Committer: Miguel Ferreira <miguelferreira@me.com>
Committed: Tue Aug 25 14:50:29 2015 +0200

----------------------------------------------------------------------
 tools/marvin/marvin/deployDataCenter.py | 112 +++++++++++++++------------
 1 file changed, 62 insertions(+), 50 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/abb824e3/tools/marvin/marvin/deployDataCenter.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/deployDataCenter.py b/tools/marvin/marvin/deployDataCenter.py
index 4fcd696..3dd5667 100644
--- a/tools/marvin/marvin/deployDataCenter.py
+++ b/tools/marvin/marvin/deployDataCenter.py
@@ -534,7 +534,7 @@ class DeployDataCenters(object):
                     netprov.physicalnetworkid = phynetwrk.id
                     result = self.__apiClient.addNetworkServiceProvider(netprov)
                     self.enableProvider(result.id)
-                elif provider.name in ['Netscaler', 'JuniperSRX', 'F5BigIp']:
+                elif provider.name in ['Netscaler', 'JuniperSRX', 'F5BigIp', 'NiciraNvp']:
                     netprov = addNetworkServiceProvider.\
                         addNetworkServiceProviderCmd()
                     netprov.name = provider.name
@@ -548,55 +548,67 @@ class DeployDataCenters(object):
                         self.__addToCleanUp(
                             "NetworkServiceProvider",
                             result.id)
-                    for device in provider.devices:
-                        if provider.name == 'Netscaler':
-                            dev = addNetscalerLoadBalancer.\
-                                addNetscalerLoadBalancerCmd()
-                            dev.username = device.username
-                            dev.password = device.password
-                            dev.networkdevicetype = device.networkdevicetype
-                            dev.url = configGenerator.getDeviceUrl(device)
-                            dev.physicalnetworkid = phynetwrk.id
-                            ret = self.__apiClient.addNetscalerLoadBalancer(
-                                dev)
-                            if ret.id:
+                    if provider.devices is not None:
+                        for device in provider.devices:
+                            if provider.name == 'Netscaler':
+                                dev = addNetscalerLoadBalancer.\
+                                    addNetscalerLoadBalancerCmd()
+                                dev.username = device.username
+                                dev.password = device.password
+                                dev.networkdevicetype = device.networkdevicetype
+                                dev.url = configGenerator.getDeviceUrl(device)
+                                dev.physicalnetworkid = phynetwrk.id
+                                ret = self.__apiClient.addNetscalerLoadBalancer(
+                                    dev)
+                                if ret.id:
+                                    self.__tcRunLogger.\
+                                        debug("==== AddNetScalerLB "
+                                              "Successful=====")
+                                    self.__addToCleanUp(
+                                        "NetscalerLoadBalancer",
+                                        ret.id)
+                            elif provider.name == 'JuniperSRX':
+                                dev = addSrxFirewall.addSrxFirewallCmd()
+                                dev.username = device.username
+                                dev.password = device.password
+                                dev.networkdevicetype = device.networkdevicetype
+                                dev.url = configGenerator.getDeviceUrl(device)
+                                dev.physicalnetworkid = phynetwrk.id
+                                ret = self.__apiClient.addSrxFirewall(dev)
+                                if ret.id:
+                                    self.__tcRunLogger.\
+                                        debug("==== AddSrx "
+                                              "Successful=====")
+                                    self.__addToCleanUp("SrxFirewall", ret.id)
+                            elif provider.name == 'F5BigIp':
+                                dev = addF5LoadBalancer.addF5LoadBalancerCmd()
+                                dev.username = device.username
+                                dev.password = device.password
+                                dev.networkdevicetype = device.networkdevicetype
+                                dev.url = configGenerator.getDeviceUrl(device)
+                                dev.physicalnetworkid = phynetwrk.id
+                                ret = self.__apiClient.addF5LoadBalancer(dev)
+                                if ret.id:
+                                    self.__tcRunLogger.\
+                                        debug("==== AddF5 "
+                                              "Successful=====")
+                                    self.__addToCleanUp("F5LoadBalancer", ret.id)
+                            elif provider.name == 'NiciraNvp':
+                                cmd =  addNiciraNvpDevice.addNiciraNvpDeviceCmd()
+                                cmd.hostname = device.hostname
+                                cmd.username = device.username
+                                cmd.password = device.password
+                                cmd.transportzoneuuid = device.transportzoneuuid
+                                cmd.physicalnetworkid = phynetwrk.id
+                                ret = self.__apiClient.addNiciraNvpDevice(cmd)
                                 self.__tcRunLogger.\
-                                    debug("==== AddNetScalerLB "
-                                          "Successful=====")
-                                self.__addToCleanUp(
-                                    "NetscalerLoadBalancer",
-                                    ret.id)
-                        elif provider.name == 'JuniperSRX':
-                            dev = addSrxFirewall.addSrxFirewallCmd()
-                            dev.username = device.username
-                            dev.password = device.password
-                            dev.networkdevicetype = device.networkdevicetype
-                            dev.url = configGenerator.getDeviceUrl(device)
-                            dev.physicalnetworkid = phynetwrk.id
-                            ret = self.__apiClient.addSrxFirewall(dev)
-                            if ret.id:
-                                self.__tcRunLogger.\
-                                    debug("==== AddSrx "
-                                          "Successful=====")
-                                self.__addToCleanUp("SrxFirewall", ret.id)
-                        elif provider.name == 'F5BigIp':
-                            dev = addF5LoadBalancer.addF5LoadBalancerCmd()
-                            dev.username = device.username
-                            dev.password = device.password
-                            dev.networkdevicetype = device.networkdevicetype
-                            dev.url = configGenerator.getDeviceUrl(device)
-                            dev.physicalnetworkid = phynetwrk.id
-                            ret = self.__apiClient.addF5LoadBalancer(dev)
-                            if ret.id:
-                                self.__tcRunLogger.\
-                                    debug("==== AddF5 "
-                                          "Successful=====")
-                                self.__addToCleanUp("F5LoadBalancer", ret.id)
-                        else:
-                            raise InvalidParameterException(
-                                "Device %s doesn't match "
-                                "any know provider "
-                                "type" % device)
+                                    debug("==== AddNiciraNvp Successful =====")
+                                self.__addToCleanUp("NiciraNvp", ret.id)
+                            else:
+                                raise InvalidParameterException(
+                                    "Device %s doesn't match "
+                                    "any know provider "
+                                    "type" % device)
                     self.enableProvider(result.id)
         except Exception as e:
             print "Exception Occurred: %s" % GetDetailExceptionInfo(e)
@@ -1133,7 +1145,7 @@ if __name__ == "__main__":
             print "\n===Deploy Failed==="
             tc_run_logger.debug("\n===Deploy Failed===");
             exit(1)
-            
+
 
     if options.remove and os.path.isfile(options.remove) and options.input:
         '''


Mime
View raw message