Skip to content

Commit

Permalink
Update auth.py
Browse files Browse the repository at this point in the history
  • Loading branch information
acedrew authored Oct 10, 2023
1 parent 631254d commit 03d11ea
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion volttron/platform/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 03d11ea

Please sign in to comment.