Skip to content

Commit

Permalink
Don't try to sort SecretsProvider class objects in plugin config fe…
Browse files Browse the repository at this point in the history
…atures registry (#1065)

* Fix TypeError when trying to sort `SecretsProvider` class objects
* Don't sort `secrets_providers` when added to features.
  • Loading branch information
jathanism committed Nov 11, 2021
1 parent 5801280 commit 03bb07c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion nautobot/extras/plugins/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def ready(self):
if secrets_providers is not None:
for secrets_provider in secrets_providers:
register_secrets_provider(secrets_provider)
self.features["secrets_providers"] = sorted(secrets_providers)
self.features["secrets_providers"] = secrets_providers

@classmethod
def validate(cls, user_config, nautobot_version):
Expand Down
3 changes: 3 additions & 0 deletions nautobot/extras/secrets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
class SecretsProvider(ABC):
"""Abstract base class for concrete providers of secret retrieval features."""

def __repr__(self):
return f"<{self.name}>"

@abstractproperty
def slug(self):
"""String uniquely identifying this class; will be used as a key to look up the class owning a given Secret."""
Expand Down

0 comments on commit 03bb07c

Please sign in to comment.