Skip to content

Commit

Permalink
Adhere to PEP 8 style guide
Browse files Browse the repository at this point in the history
 - max line width of 80 characters
 - avoid backslashes
  • Loading branch information
Marko Bastovanovic committed Mar 1, 2019
1 parent 75b0a14 commit ee1b0e9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions emr_cost_calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ def is_error_retriable(exception):
Use this function in order to back off only
if error is retriable
"""
# TODO verify if this is correct way to handle this. Haven't seen errors like this myself
# TODO verify if this is correct way to handle this. Haven't seen errors
# TODO like this myself
try:
return exception.response['Error']['Code'].startswith("5")
except AttributeError:
Expand All @@ -57,7 +58,8 @@ def is_error_retriable(exception):

class Ec2Instance:
def __init__(self, creation_ts, termination_ts, instance_type, market_type):
# creation_ts (EMR instance group parameter) correlates to EC2 instance start up time
# creation_ts (EMR instance group parameter) correlates to EC2 instance
# start up time
self.creation_ts = creation_ts
self.termination_ts = termination_ts
self.instance_type = instance_type
Expand Down Expand Up @@ -147,7 +149,8 @@ def __init__(
sys.exit()

try:
self.spot_pricing = SpotPricing(region, aws_access_key_id, aws_secret_access_key)
self.spot_pricing = SpotPricing(region, aws_access_key_id,
aws_secret_access_key)
except:
print >> sys.stderr, \
'[ERROR] Could not establish connection with EC2 API'
Expand Down

0 comments on commit ee1b0e9

Please sign in to comment.