trek10inc / awsume

A utility for easily assuming AWS IAM roles from the command line.
https://awsu.me
MIT License
485 stars 90 forks source link

TypeError: list indices must be integers or slices, not str #207

Closed GersonRosales closed 1 year ago

GersonRosales commented 1 year ago

I'm getting this error after install and make the configuration

bash-3.2$ awsume
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.10/bin/awsumepy", line 8, in <module>
    sys.exit(main())
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/awsume/awsumepy/main.py", line 29, in main
    run_awsume(sys.argv[1:])
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/awsume/awsumepy/main.py", line 16, in run_awsume
    awsume = app.Awsume()
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/awsume/awsumepy/app.py", line 33, in __init__
    self.config['is_interactive'] = is_interactive
TypeError: list indices must be integers or slices, not str

This is the versions I'm using

MacOs Monterey 12.1
awsume                   4.5.3
Python 3.10.6
LucasZielke commented 1 year ago

It seems possible that your config file could have been improperly built. Verify if you have a file located at ~/.awsume/config.yaml With contents similar to:

colors: true
fuzzy-match: false
role-duration: 0

Seems that if the yaml file at the base level is a list it could cause the above error.

Alternatively, removing the config.yaml should initiate the rebuild from defaults upon next invocation. (Above provided config is the default)

GersonRosales commented 1 year ago

it worked! thanks!!