binbashar / leverage

Binbash Leverage CLI intended to orchestrate Leverage Reference Architecture for AWS (www.binbash.co/leverage)
https://pypi.org/project/leverage/
Apache License 2.0
17 stars 2 forks source link

'AWSCLIContainer' object has no attribute 'common_conf #242

Closed rynkowsg closed 7 months ago

rynkowsg commented 7 months ago

Describe the Bug

$ leverage credentials configure --type BOOTSTRAP
[12:55:47.259] INFO     Reading info from project.yaml                                                                 
[12:55:47.289] INFO     Loading configuration file.                                                                    
[12:55:47.296] INFO     Loading project environment configuration file.                                                
[12:55:47.297] INFO     Loading Terraform common configuration.                                                        
Traceback (most recent call last):
  File "/home/user/src/my/simple-cgt/projects/infra/leverage/.venv/bin/leverage", line 8, in <module>
    sys.exit(leverage())
             ^^^^^^^^^^
  File "/home/user/src/my/simple-cgt/projects/infra/leverage/.venv/lib64/python3.11/site-packages/click/core.py", line 1137, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/src/my/simple-cgt/projects/infra/leverage/.venv/lib64/python3.11/site-packages/click/core.py", line 1062, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/home/user/src/my/simple-cgt/projects/infra/leverage/.venv/lib64/python3.11/site-packages/click/core.py", line 1668, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/src/my/simple-cgt/projects/infra/leverage/.venv/lib64/python3.11/site-packages/click/core.py", line 1668, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/src/my/simple-cgt/projects/infra/leverage/.venv/lib64/python3.11/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/src/my/simple-cgt/projects/infra/leverage/.venv/lib64/python3.11/site-packages/click/core.py", line 763, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/src/my/simple-cgt/projects/infra/leverage/.venv/lib64/python3.11/site-packages/leverage/modules/credentials.py", line 723, in configure
    config_values = _load_configs_for_credentials()
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/src/my/simple-cgt/projects/infra/leverage/.venv/lib64/python3.11/site-packages/leverage/modules/credentials.py", line 315, in _load_configs_for_credentials
    terraform_config = AWSCLI.common_conf
                       ^^^^^^^^^^^^^^^^^^
AttributeError: 'AWSCLIContainer' object has no attribute 'common_conf'

Expected Behavior

Should not happen.

Steps to Reproduce

Install 1.12.0 and try to command above.

Screenshots

none

Environment (please complete the following information):

Anything that will help us triage the bug will help. Here are some ideas:

Additional Context

The clue might be here:

AttributeError: 'AWSCLIContainer' object has no attribute 'common_conf'

In the recently merged PR, the common_conf was moved to PathsHandler. Haven't tested it, but based on these changes AWSCLI.common_conf should be replaced with AWSCLI.paths.common_conf.

rynkowsg commented 7 months ago

I created a tiny PR fixing this issue HERE.

Franr commented 7 months ago

@rynkowsg thanks for your contribution Greg! :rocket:

This is already released on v1.12.1