From 1fc07185546d6ec301e3252b5c875445a7210a3d Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Wed, 7 Sep 2022 07:50:39 -0400 Subject: [PATCH] Agent: Use isinstance() to check if identity is Username --- .../aggregating_propagation_credentials_repository.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monkey/infection_monkey/credential_repository/aggregating_propagation_credentials_repository.py b/monkey/infection_monkey/credential_repository/aggregating_propagation_credentials_repository.py index cffa2b277..f7c86c30d 100644 --- a/monkey/infection_monkey/credential_repository/aggregating_propagation_credentials_repository.py +++ b/monkey/infection_monkey/credential_repository/aggregating_propagation_credentials_repository.py @@ -45,7 +45,7 @@ class AggregatingPropagationCredentialsRepository(IPropagationCredentialsReposit self._add_secret(credentials.secret) def _add_identity(self, identity: Identity): - if type(identity) == Username: + if isinstance(identity, Username): self._stored_credentials.setdefault("exploit_user_list", set()).add(identity.username) def _add_secret(self, secret: Secret):