sopel / botocross

A Python package for operating cross region AWS resources
Other
4 stars 4 forks source link

self.alias = alias['list_account_aliases_response']['list_account_aliases_result']['account_aliases'][0] IndexError: list index out of range #21

Closed mrdavidlaing closed 11 years ago

mrdavidlaing commented 11 years ago

When running validate-credentials.py --access_key_id AKIAIFYKDxxxxx --secret_access_key tMhnxxxxx - DEBUG for a "new" user that has no groups and just a single "AdministratorAccess" user policy, the following error is thrown:

Validating credentials:
Traceback (most recent call last):
  File "/Users/mrdavidlaing/Projects/ryanholder/sudoventures/mybytes-workers/ec2-backup-to-ami/bin/validate-credentials.py", line 49, in <module>
    account = accountInfo.describe(user)
  File "/Users/mrdavidlaing/Projects/ryanholder/sudoventures/mybytes-workers/ec2-backup-to-ami/lib/python2.7/site-packages/botocross/iam/accountinfo.py", line 44, in describe
    self.alias = alias['list_account_aliases_response']['list_account_aliases_result']['account_aliases'][0]
IndexError: list index out of range

Using the same terminal, but a different access_key works fine.

sopel commented 11 years ago

@mrdavidlaing - did this happen with a new AWS account eventually, i.e. one that doesn't have an account alias assigned yet?

That would properly explain the issue and the offending code has been fixed in #22 - I'll merge and close accordingly, please reopen this issue in case the solution turns out to be insufficient.

mrdavidlaing commented 11 years ago

Correct, I was using it on a new account with no alias.

On Tuesday, November 6, 2012, Steffen Opel wrote:

@mrdavidlaing https://github.com/mrdavidlaing - did this happen with a new AWS account eventually, i.e. one that doesn't have an account alias assigned yet?

That would properly explain the issue and the offending code has been fixed in #22 https://github.com/sopel/botocross/issues/22 - I'll merge and close accordingly, please reopen this issue in case the solution turns out to be insufficient.

— Reply to this email directly or view it on GitHubhttps://github.com/sopel/botocross/issues/21#issuecomment-10119113.

David Laing Open source @ City Index - github.com/cityindex http://davidlaing.com Twitter: @davidlaing