@@ -386,13 +386,13 @@ def startCluster():
386
386
print ('Use: run.py startCluster configFile' )
387
387
sys .exit ()
388
388
389
- time = datetime .datetime .now ().replace (microsecond = 0 )
389
+ thistime = datetime .datetime .now ().replace (microsecond = 0 )
390
390
#Step 1: set up the configuration files
391
391
s3client = boto3 .client ('s3' )
392
392
ecsConfigFile = generateECSconfig (ECS_CLUSTER ,APP_NAME ,AWS_BUCKET ,s3client )
393
393
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 )
396
396
spotfleetConfig ['TargetCapacity' ]= CLUSTER_MACHINES
397
397
spotfleetConfig ['SpotPrice' ] = '%.2f' % MACHINE_PRICE
398
398
DOCKER_BASE_SIZE = int (round (float (EBS_VOL_SIZE )/ int (TASKS_PER_MACHINE ))) - 2
@@ -442,7 +442,7 @@ def startCluster():
442
442
status = ec2client .describe_spot_fleet_instances (SpotFleetRequestId = requestInfo ['SpotFleetRequestId' ])
443
443
while len (status ['ActiveInstances' ]) < CLUSTER_MACHINES :
444
444
# 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 )
446
446
if len (errorcheck ['HistoryRecords' ]) != 0 :
447
447
print ('Your spot fleet request is causing an error and is now being cancelled. Please check your configuration and try again' )
448
448
for eacherror in errorcheck ['HistoryRecords' ]:
0 commit comments