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