memosstilvi / emr-cost-calculator

EMR Cost Calculator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issue with retrying.py module

Laxman-SM opened this issue · comments

python2.7 emr_cost_calculator.py cluster --region=us-east-1c --cluster_id=j-WDGRM50XNDZQ --aws_access_key_id= --aws_secret_access_key=

enable: print(sys.executable) on 34,35,36 on emr_cost_calculator.py
execution output:-

/usr/local/opt/python/bin/python2.7
/usr/local/opt/python/bin/python2.7
/usr/local/opt/python/bin/python2.7
[INFO] Retrieving cost in region us-east-1c
Traceback (most recent call last):
File "emr_cost_calculator.py", line 238, in
print calc.get_cluster_cost(args.get('--cluster_id'))
File "/usr/local/lib/python2.7/site-packages/retrying.py", line 49, in wrapped_f
return Retrying(*dargs, **dkw).call(f, *args, **kw)
File "/usr/local/lib/python2.7/site-packages/retrying.py", line 206, in call
return attempt.get(self._wrap_exception)
File "/usr/local/lib/python2.7/site-packages/retrying.py", line 247, in get
six.reraise(self.value[0], self.value[1], self.value[2])
File "/usr/local/lib/python2.7/site-packages/retrying.py", line 200, in call
attempt = Attempt(fn(*args, **kwargs), attempt_number, False)
File "emr_cost_calculator.py", line 132, in get_cluster_cost
instance_groups = self._get_instance_groups(cluster_id)
File "emr_cost_calculator.py", line 176, in _get_instance_groups
groups = self.conn.list_instance_groups(cluster_id).instancegroups
AttributeError: 'NoneType' object has no attribute 'list_instance_groups'

module version : 'retrying==1.3.3' 'docopt==0.6.2' 'docutils==0.12' 'pyyaml==3.12'

six version is update on my mac 'six==1.10.0'
boto version is update to 'boto==2.39.0'
pyyaml version is update to 'pyyaml==3.12'

i'm unable to get the issue, can you please review the stack trace. thanks in advance.

ERROR on google: https://julien.danjou.info/blog/2015/python-retrying

Hey @Laxman-SM, thank you for your feedback.

I think the issue in your case is that you pass the availability zone as a parameter to the script, instead of the region.

More specifically:

Instead of: 
--region=us-east-1c

Try using:
--region=us-east-1

Check here for the difference between regions and availability zones.

I consider the issue closed, please let me know if the issue persists.