Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS profile choice default throws IndexError #128

Closed
nsorros opened this issue Jan 29, 2021 · 2 comments · Fixed by #129
Closed

AWS profile choice default throws IndexError #128

nsorros opened this issue Jan 29, 2021 · 2 comments · Fixed by #129
Assignees
Labels
bug Something isn't working

Comments

@nsorros
Copy link
Contributor

nsorros commented Jan 29, 2021

Running sagify init and selecting the default aws profile by clicking enter instead of typing 1 throws an IndexError

Select AWS profile:
1 - default
Choose from 1 [1]:
Traceback (most recent call last):
  File "/data/code/sagemaker/sagify-demo/venv/bin/sagify", line 8, in <module>
    sys.exit(cli())
  File "/data/code/sagemaker/sagify-demo/venv/lib/python3.6/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/data/code/sagemaker/sagify-demo/venv/lib/python3.6/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/data/code/sagemaker/sagify-demo/venv/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/data/code/sagemaker/sagify-demo/venv/lib/python3.6/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/data/code/sagemaker/sagify-demo/venv/lib/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/data/code/sagemaker/sagify-demo/venv/lib/python3.6/site-packages/sagify/commands/initialize.py", line 129, in init
    aws_profile, aws_region = ask_for_aws_details()
  File "/data/code/sagemaker/sagify-demo/venv/lib/python3.6/site-packages/sagify/commands/initialize.py", line 97, in ask_for_aws_details
    chosen_profile = available_profiles[chosen_profile_index]
IndexError: list index out of range

This is probably because the validation, which reduces the index does not run in the case so the default choise of 1 remains and in the case of 1 profile that throws an error. In the case of multiple profiles, the wrong profile is selected.

@pm3310 pm3310 added the bug Something isn't working label Jan 29, 2021
@pm3310 pm3310 self-assigned this Jan 29, 2021
@pm3310
Copy link
Contributor

pm3310 commented Jan 29, 2021

Hey @nsorros thank you for catching it.

@pm3310
Copy link
Contributor

pm3310 commented Jan 29, 2021

@nsorros Just released 0.20.9 with your fix :-)

@pm3310 pm3310 closed this as completed Jan 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants