From 03d11eaa0fee7caeb60d9363ecaa74b60f35ee3b Mon Sep 17 00:00:00 2001 From: Andrew Rodgers Date: Tue, 10 Oct 2023 13:36:02 -0400 Subject: [PATCH] Update auth.py --- volttron/platform/auth.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/volttron/platform/auth.py b/volttron/platform/auth.py index 81bf4ab5f0..8c2c5ed370 100644 --- a/volttron/platform/auth.py +++ b/volttron/platform/auth.py @@ -127,6 +127,7 @@ def __init__( self._protected_topics_file_path = os.path.abspath( protected_topics_file ) + self._protected_topics_file_hash = None self._protected_topics_for_rmq = ProtectedPubSubTopics() self._setup_mode = setup_mode self._auth_pending = [] @@ -565,7 +566,7 @@ def _read_protected_topics_file(self): # Use gevent FileObject to avoid blocking the thread data = FileObject(fil, close=False).read() current_hash = hashlib.sha256(data.encode()).hexdigest() - if self._protected_topics_file_hash: + if self._protected_topics_file_hash and hasattr(self, "_protected_topics"): if current_hash == self._protected_topics_file_hash: return self._protected_topics_file_hash = current_hash