Repository: cloudstack
Updated Branches:
  refs/heads/4.4-forward d5fbcafc2 -> 6f3ff0682


Added fix for CLOUDSTACK-6529

Fixed to continue adding all hosts, even if any addition fails and remove
unused args from host class.

Signed-off-by: santhosh <santhosh.eduku...@gmail.com>
Signed-off-by: Abhinandan Prateek <aprat...@apache.org>


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

Branch: refs/heads/4.4-forward
Commit: 6f3ff068270f48e00531c462de4f7d76395658ff
Parents: d5fbcaf
Author: santhosh <santhosh.eduku...@gmail.com>
Authored: Fri May 23 22:35:58 2014 +1000
Committer: Abhinandan Prateek <aprat...@apache.org>
Committed: Mon May 26 10:44:23 2014 +0530

----------------------------------------------------------------------
 tools/marvin/marvin/configGenerator.py  |  5 +---
 tools/marvin/marvin/deployDataCenter.py | 34 +++++++++++++++++-----------
 2 files changed, 22 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6f3ff068/tools/marvin/marvin/configGenerator.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/configGenerator.py 
b/tools/marvin/marvin/configGenerator.py
index 66609da..191f08e 100644
--- a/tools/marvin/marvin/configGenerator.py
+++ b/tools/marvin/marvin/configGenerator.py
@@ -154,11 +154,8 @@ class host(object):
         self.podid = None
         self.clusterid = None
         self.clustername = None
-        self.cpunumber = None
-        self.cpuspeed = None
-        self.hostmac = None
         self.hosttags = None
-        self.memory = None
+        self.allocationstate = None
 
 
 class physicalNetwork(object):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6f3ff068/tools/marvin/marvin/deployDataCenter.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/deployDataCenter.py 
b/tools/marvin/marvin/deployDataCenter.py
index 4d8be58..22b78ab 100644
--- a/tools/marvin/marvin/deployDataCenter.py
+++ b/tools/marvin/marvin/deployDataCenter.py
@@ -117,18 +117,16 @@ class DeployDataCenters(object):
             self.__cleanUp["order"].append(type)
 
     def addHosts(self, hosts, zoneId, podId, clusterId, hypervisor):
-        try:
-            if hosts is None:
-                return
-            for host in hosts:
+        if hosts is None:
+            print "\n === Invalid Hosts Information ===="
+            return
+        failed_cnt = 0
+        for host in hosts:
+            try:
                 hostcmd = addHost.addHostCmd()
                 hostcmd.clusterid = clusterId
-                hostcmd.cpunumber = host.cpunumer
-                hostcmd.cpuspeed = host.cpuspeed
-                hostcmd.hostmac = host.hostmac
                 hostcmd.hosttags = host.hosttags
                 hostcmd.hypervisor = host.hypervisor
-                hostcmd.memory = host.memory
                 hostcmd.password = host.password
                 hostcmd.podid = podId
                 hostcmd.url = host.url
@@ -139,10 +137,15 @@ class DeployDataCenters(object):
                 if ret:
                     self.__tcRunLogger.debug("=== Add Host Successful ===")
                     self.__addToCleanUp("Host", ret[0].id)
-        except Exception as e:
-            print "Exception Occurred %s" % GetDetailExceptionInfo(e)
-            self.__tcRunLogger.exception("=== Adding Host Failed ===")
-            self.__cleanAndExit()
+            except Exception as e:
+                failed_cnt = failed_cnt + 1
+                print "Exception Occurred :%s" % GetDetailExceptionInfo(e)
+                self.__tcRunLogger.exception(
+                    "=== Adding Host Failed :%s===" % str(
+                        host.url))
+                if failed_cnt == len(hosts):
+                    self.__cleanAndExit()
+                continue
 
     def addVmWareDataCenter(self, vmwareDc):
         try:
@@ -516,7 +519,8 @@ class DeployDataCenters(object):
                         self.enableProvider(pnetprovres[0].id)
                     elif provider.name == 'SecurityGroupProvider':
                         self.enableProvider(pnetprovres[0].id)
-                elif provider.name in ['JuniperContrailRouter', 
'JuniperContrailVpcRouter']:
+                elif provider.name in ['JuniperContrailRouter',
+                                       'JuniperContrailVpcRouter']:
                     netprov = addNetworkServiceProvider.\
                         addNetworkServiceProviderCmd()
                     netprov.name = provider.name
@@ -1073,6 +1077,10 @@ if __name__ == "__main__":
     '''
     Step1: Create the Logger
     '''
+    if (options.input) and not (os.path.isfile(options.input)):
+        print "\n=== Invalid Input Config File Path, Please Check ==="
+        exit(1)
+
     log_obj = MarvinLog("CSLog")
     cfg = configGenerator.getSetupConfig(options.input)
     log = cfg.logger

Reply via email to