Skip to content

Commit

Permalink
Merge pull request #253 from 4dn-dcic/idle
Browse files Browse the repository at this point in the history
EC2IDLE exception not raised fixed
  • Loading branch information
SooLee authored Oct 15, 2019
2 parents c9a834d + ca23c07 commit 67fa8ce
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tibanna/check_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def run(self):
return input_json_copy

# checking if instance is terminated for no reason
instance_id = input_json_copy.get('instance_id', '')
instance_id = input_json_copy['config'].get('instance_id', '')
if instance_id: # skip test for instance_id by not giving it to input_json_copy
try:
res = boto3.client('ec2').describe_instances(InstanceIds=[instance_id])
Expand All @@ -94,7 +94,7 @@ def run(self):
jobstart_time = boto3.client('s3').get_object(Bucket=bucket_name, Key=job_started).get('LastModified')
if jobstart_time + timedelta(hours=1) < end:
try:
cw_res = TibannaResource(instance_id, filesystem, start, end).as_dict()
cw_res = self.TibannaResource(instance_id, filesystem, start, end).as_dict()
except Exception as e:
raise MetricRetrievalException(e)
if 'max_cpu_utilization_percent' in cw_res:
Expand Down

0 comments on commit 67fa8ce

Please sign in to comment.