@@ -117,18 +117,16 @@ def __addToCleanUp(self, type, id):
117117 self .__cleanUp ["order" ].append (type )
118118
119119 def addHosts (self , hosts , zoneId , podId , clusterId , hypervisor ):
120- try :
121- if hosts is None :
122- return
123- for host in hosts :
120+ if hosts is None :
121+ print "\n === Invalid Hosts Information ===="
122+ return
123+ failed_cnt = 0
124+ for host in hosts :
125+ try :
124126 hostcmd = addHost .addHostCmd ()
125127 hostcmd .clusterid = clusterId
126- hostcmd .cpunumber = host .cpunumer
127- hostcmd .cpuspeed = host .cpuspeed
128- hostcmd .hostmac = host .hostmac
129128 hostcmd .hosttags = host .hosttags
130129 hostcmd .hypervisor = host .hypervisor
131- hostcmd .memory = host .memory
132130 hostcmd .password = host .password
133131 hostcmd .podid = podId
134132 hostcmd .url = host .url
@@ -139,10 +137,15 @@ def addHosts(self, hosts, zoneId, podId, clusterId, hypervisor):
139137 if ret :
140138 self .__tcRunLogger .debug ("=== Add Host Successful ===" )
141139 self .__addToCleanUp ("Host" , ret [0 ].id )
142- except Exception as e :
143- print "Exception Occurred %s" % GetDetailExceptionInfo (e )
144- self .__tcRunLogger .exception ("=== Adding Host Failed ===" )
145- self .__cleanAndExit ()
140+ except Exception as e :
141+ failed_cnt = failed_cnt + 1
142+ print "Exception Occurred :%s" % GetDetailExceptionInfo (e )
143+ self .__tcRunLogger .exception (
144+ "=== Adding Host Failed :%s===" % str (
145+ host .url ))
146+ if failed_cnt == len (hosts ):
147+ self .__cleanAndExit ()
148+ continue
146149
147150 def addVmWareDataCenter (self , vmwareDc ):
148151 try :
@@ -516,7 +519,8 @@ def configureProviders(self, phynetwrk, providers):
516519 self .enableProvider (pnetprovres [0 ].id )
517520 elif provider .name == 'SecurityGroupProvider' :
518521 self .enableProvider (pnetprovres [0 ].id )
519- elif provider .name in ['JuniperContrailRouter' , 'JuniperContrailVpcRouter' ]:
522+ elif provider .name in ['JuniperContrailRouter' ,
523+ 'JuniperContrailVpcRouter' ]:
520524 netprov = addNetworkServiceProvider .\
521525 addNetworkServiceProviderCmd ()
522526 netprov .name = provider .name
@@ -1073,6 +1077,10 @@ def removeDataCenter(self):
10731077 '''
10741078 Step1: Create the Logger
10751079 '''
1080+ if (options .input ) and not (os .path .isfile (options .input )):
1081+ print "\n === Invalid Input Config File Path, Please Check ==="
1082+ exit (1 )
1083+
10761084 log_obj = MarvinLog ("CSLog" )
10771085 cfg = configGenerator .getSetupConfig (options .input )
10781086 log = cfg .logger
0 commit comments