Skip to content

Commit

Permalink
fix(__get_attr__): non-existant attribute lookup (hvac#982)
Browse files Browse the repository at this point in the history
fix(__get_attr__): typo

Explicit default_kv_version AttributeError
  • Loading branch information
m4dh4t authored Jun 18, 2023
1 parent 54ab41b commit 3b4e5ca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions hvac/api/secrets_engines/kv.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ def __getattr__(self, item):
:return: The selected secrets_engines class corresponding to this instance's default_kv_version setting
:rtype: hvac.api.vault_api_base.VaultApiBase
"""
if item in ["_default_kv_version", "default_kv_version"]:
raise AttributeError
if self.default_kv_version == "1":
return getattr(self._kv_v1, item)
elif self.default_kv_version == "2":
Expand Down
2 changes: 2 additions & 0 deletions hvac/api/vault_api_category.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ def __getattr__(self, item):
:return: The requested class instance where available.
:rtype: hvac.api.VaultApiBase
"""
if item == "implemented_class_names":
raise AttributeError
if item in self.implemented_class_names:
private_attr_name = self.get_private_attr_name(item)
return getattr(self, private_attr_name)
Expand Down

0 comments on commit 3b4e5ca

Please sign in to comment.