vavavr00m / boto

Automatically exported from code.google.com/p/boto
1 stars 0 forks source link

boto.ec2.regions() bug? #525

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. install boto-2.0b1 with python2.6 on centos
2. >>>import boto
3. >>>boto.ec2.regions()

What is the expected output? What do you see instead?
A list of RegionInfo

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.6/site-packages/boto-2.0b1-py2.6.egg/boto/ec2/__init__.py", line 38, in regions
    c = EC2Connection(**kw_params)
  File "/usr/lib/python2.6/site-packages/boto-2.0b1-py2.6.egg/boto/ec2/connection.py", line 80, in __init__
    https_connection_factory, path)
  File "/usr/lib/python2.6/site-packages/boto-2.0b1-py2.6.egg/boto/connection.py", line 515, in __init__
    debug,  https_connection_factory, path)
  File "/usr/lib/python2.6/site-packages/boto-2.0b1-py2.6.egg/boto/connection.py", line 186, in __init__
    self.hmac = hmac.new(self.aws_secret_access_key, digestmod=sha)
  File "/usr/lib/python2.6/hmac.py", line 133, in new
    return HMAC(key, msg, digestmod)
  File "/usr/lib/python2.6/hmac.py", line 68, in __init__
    if len(key) > blocksize:
TypeError: object of type 'NoneType' has no len()

What version of the product are you using? On what operating system?
boto-2.0b1 python2.6 centos5.5

Please provide any additional information below.
same problem with boto.ec2.get_region('us-east-1')

Original issue reported on code.google.com by jass.z...@gmail.com on 14 Jun 2011 at 9:56

GoogleCodeExporter commented 9 years ago
Although the error message you are receiving gives you no clue whatsoever, I 
suspect that the problem is that bot is not able to find your AWS credentials.  
I believe the latest version of the code in the RC1 release gives you a better 
error message.

Original comment by Mitch.Ga...@gmail.com on 14 Jun 2011 at 1:13

GoogleCodeExporter commented 9 years ago
I see. 

I am manipulating multiple AWS accounts with one backend daemon, which calls 
boto API. So Is there a way to get RegionInfo object without AWS credentials?

Original comment by jass.z...@gmail.com on 14 Jun 2011 at 3:08

GoogleCodeExporter commented 9 years ago
You can just create a RegionInfo object manually, like this:

>>> from boto.ec2.regioninfo import RegionInfo
>>> r = RegionInfo(name='us-east-1', endpoint='ec2.amazon.com')
>>> conn = r.connect()

Original comment by Mitch.Ga...@gmail.com on 15 Jun 2011 at 11:17

GoogleCodeExporter commented 9 years ago
I'm going to close this.  Re-open if you think further action is required.

Original comment by Mitch.Ga...@gmail.com on 18 Jun 2011 at 12:50