quixey / python-aliyun

Python API client for Aliyun, the Alibaba Cloud.
Apache License 2.0
37 stars 24 forks source link

Misc fixes #14

Closed heikkiquixey closed 9 years ago

heikkiquixey commented 9 years ago

@mquander @addumb Please review.

addumb commented 9 years ago

Looks good! I think there's something up in find_credentials:

python ./ali.py -S ecs -r cn-hangzhou Action=DescribeRegions
Traceback (most recent call last):
  File "./ali.py", line 85, in <module>
    secret_access_key=args.secret_access_key)
  File "/home/adam/qsrc/python-aliyun/aliyun/connection.py", line 119, in __init__
    creds = find_credentials()
  File "/home/adam/qsrc/python-aliyun/aliyun/connection.py", line 79, in find_credentials
    creds.access_key_id = cp.get('default', 'access_key_id')
AttributeError: can't set attribute

Ah yeah, namedtuples are immutable, and the config file discovery mechanism isn't working.

heikkiquixey commented 9 years ago

Wait, this code never worked?

addumb commented 9 years ago

Whoaaaaaaaaaa we were actually adding attributes to the namedtuple module not to the named tuple itself... and passing those around as if they were credentials.