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

Cannot consume keeper_config as an inline encrypted variable #674

Open
ZarrenSpryXplor opened this issue Oct 14, 2024 · 1 comment
Open

Comments

@ZarrenSpryXplor
Copy link

When trying to consume the Keeper configuration via an inline encrypted variable, the following error is received.

exception during Jinja2 execution: Traceback (most recent call last):
  File "/Users/uk-gr9yjx0l0y/Projects/payments-ansible-awx/collections/ansible_collections/keepersecurity/keeper_secrets_manager/plugins/common/keeper_secrets_manager_ansible/__init__.py", line 253, in __init__
    config_instance = InMemoryKeyValueStorage(config=config_option)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/uk-gr9yjx0l0y/Library/Caches/pypoetry/virtualenvs/payments-ansible-awx-yKeAqXPR-py3.11/lib/python3.11/site-packages/keeper_secrets_manager_core/storage.py", line 193, in __init__
    self.config[ConfigKeys.get_enum(key)] = config[key]
                                            ~~~~~~^^^^^
  File "/Users/uk-gr9yjx0l0y/Library/Caches/pypoetry/virtualenvs/payments-ansible-awx-yKeAqXPR-py3.11/lib/python3.11/site-packages/ansible/parsing/yaml/objects.py", line 189, in __getitem__
    return self.data[index]
           ~~~~~~~~~^^^^^^^
TypeError: string indices must be integers, not 'str'
@ZarrenSpryXplor
Copy link
Author

This can be resolved by converting the object to string although I'm not sure if this the correct way to approach the issue.

config_instance = InMemoryKeyValueStorage(config=str(config_option))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant