Skip to content

Commit

Permalink
fixes credential cache when using Nautobot secrets (#153)
Browse files Browse the repository at this point in the history
The cherry-picked feature included the new (2.x) name for the relation
'Secret -> SecretsGroupAssociation' - this branch should use the 1.6
name.
  • Loading branch information
Kircheneer authored Apr 18, 2024
1 parent 4ac49db commit fb4469a
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,10 @@ def get_device_creds(self, device):
for sec in device.secrets_group.secrets.all():
secret_value = self.creds_cache.get(self._get_or_cache_secret_key(device, sec))
current_secret_type = getattr(
SecretsGroupSecretTypeChoices, f"TYPE_{sec.secrets_group_associations.first().secret_type.upper()}"
SecretsGroupSecretTypeChoices, f"TYPE_{sec.secretsgroupassociation_set.first().secret_type.upper()}"
)
current_access_type = getattr(
SecretsGroupAccessTypeChoices, f"TYPE_{sec.secrets_group_associations.first().access_type.upper()}"
SecretsGroupAccessTypeChoices, f"TYPE_{sec.secretsgroupassociation_set.first().access_type.upper()}"
)
configured_access_type = _get_access_type_value(device)
if (
Expand Down

0 comments on commit fb4469a

Please sign in to comment.