@@ -43,12 +43,12 @@ def handleArguments(argv):
4343 DEBUG = 0
4444 global DRYRUN
4545 DRYRUN = 1
46+ global PREPARE
47+ PREPARE = 0
4648 global clustername
4749 clustername = ''
4850 global configProfileName
4951 configProfileName = ''
50- global force
51- force = 0
5252 global ignoreHostList
5353 ignoreHostList = ""
5454 global ignoreHosts
@@ -63,12 +63,13 @@ def handleArguments(argv):
6363 '\n --ignore-hosts <list>\t \t \t \t Skip work on the specified hosts (for example if you need to resume): Example: --ignore-hosts="host1, host2" ' + \
6464 '\n --threads <nr>\t \t \t \t Use this number or concurrent migration threads" ' + \
6565 '\n --debug\t \t \t \t \t Enable debug mode' + \
66- '\n --exec\t \t \t \t \t Execute for real'
66+ '\n --exec\t \t \t \t \t Execute for real' + \
67+ '\n --prepare\t \t \t \t \t Execute some prepare commands'
6768
6869 try :
6970 opts , args = getopt .getopt (
70- argv , "hc:n:t:" , [
71- "credentials-file=" , "clustername=" , "ignore-hosts=" , "threads=" , "debug" , "exec" , "force " ])
71+ argv , "hc:n:t:p " , [
72+ "credentials-file=" , "clustername=" , "ignore-hosts=" , "threads=" , "debug" , "exec" , "prepare " ])
7273 except getopt .GetoptError as e :
7374 print "Error: " + str (e )
7475 print help
@@ -90,8 +91,8 @@ def handleArguments(argv):
9091 DEBUG = 1
9192 elif opt in ("--exec" ):
9293 DRYRUN = 0
93- elif opt in ("--force " ):
94- force = 1
94+ elif opt in ("--prepare " ):
95+ PREPARE = 1
9596
9697 # Default to cloudmonkey default config file
9798 if len (configProfileName ) == 0 :
@@ -179,13 +180,13 @@ def handleArguments(argv):
179180# Put the scripts we need
180181for h in cluster_hosts :
181182 x .put_scripts (h )
182- if DRYRUN == 0 :
183+ if DRYRUN == 0 or PREPARE == 1 :
183184 x .fake_pv_tools (h )
184185 if h .name == poolmaster_name :
185186 poolmaster = h
186187
187188# Eject CDs
188- if DRYRUN == 0 :
189+ if DRYRUN == 0 or PREPARE == 1 :
189190 eject_result = x .eject_cds (poolmaster )
190191 if eject_result == False :
191192 print "Warning: Ejecting CDs failed. Continuing anyway."
0 commit comments