@@ -386,13 +386,13 @@ def startCluster():
386386 print ('Use: run.py startCluster configFile' )
387387 sys .exit ()
388388
389- time = datetime .datetime .now ().replace (microsecond = 0 )
389+ thistime = datetime .datetime .now ().replace (microsecond = 0 )
390390 #Step 1: set up the configuration files
391391 s3client = boto3 .client ('s3' )
392392 ecsConfigFile = generateECSconfig (ECS_CLUSTER ,APP_NAME ,AWS_BUCKET ,s3client )
393393 spotfleetConfig = loadConfig (sys .argv [2 ])
394- spotfleetConfig ['ValidFrom' ]= time
395- spotfleetConfig ['ValidUntil' ]= (time + datetime .timedelta (days = 365 )).replace (microsecond = 0 )
394+ spotfleetConfig ['ValidFrom' ]= thistime
395+ spotfleetConfig ['ValidUntil' ]= (thistime + datetime .timedelta (days = 365 )).replace (microsecond = 0 )
396396 spotfleetConfig ['TargetCapacity' ]= CLUSTER_MACHINES
397397 spotfleetConfig ['SpotPrice' ] = '%.2f' % MACHINE_PRICE
398398 DOCKER_BASE_SIZE = int (round (float (EBS_VOL_SIZE )/ int (TASKS_PER_MACHINE ))) - 2
@@ -442,7 +442,7 @@ def startCluster():
442442 status = ec2client .describe_spot_fleet_instances (SpotFleetRequestId = requestInfo ['SpotFleetRequestId' ])
443443 while len (status ['ActiveInstances' ]) < CLUSTER_MACHINES :
444444 # First check to make sure there's not a problem
445- errorcheck = ec2client .describe_spot_fleet_request_history (SpotFleetRequestId = requestInfo ['SpotFleetRequestId' ], EventType = 'error' , StartTime = time )
445+ errorcheck = ec2client .describe_spot_fleet_request_history (SpotFleetRequestId = requestInfo ['SpotFleetRequestId' ], EventType = 'error' , StartTime = thistime )
446446 if len (errorcheck ['HistoryRecords' ]) != 0 :
447447 print ('Your spot fleet request is causing an error and is now being cancelled. Please check your configuration and try again' )
448448 for eacherror in errorcheck ['HistoryRecords' ]:
0 commit comments