From 514d1c8747762145dd8be75f11a71be27d33bd32 Mon Sep 17 00:00:00 2001 From: John Mulligan Date: Tue, 1 Jul 2025 17:14:55 -0400 Subject: [PATCH] mgr/smb: extend the mon key store to support raw data Previously, a new protocol for raw data entries was added. Extend the MonKeyStoreEntry to meet this protocol so that it can be used to retain raw text/data blobs. Signed-off-by: John Mulligan (cherry picked from commit 8254069dba53d6bf50a76a087a692ea633a60736) --- src/pybind/mgr/smb/mon_store.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/pybind/mgr/smb/mon_store.py b/src/pybind/mgr/smb/mon_store.py index 1bea3a7200b83..58700f1c4e11c 100644 --- a/src/pybind/mgr/smb/mon_store.py +++ b/src/pybind/mgr/smb/mon_store.py @@ -146,6 +146,14 @@ class MonKeyStoreEntry: """Get the deserialized store entry value.""" return json.loads(self._store._get_val(self._key)) + def set_data(self, data: str) -> None: + """Set the store entry value to the given data.""" + self._store._set_val(self._key, data) + + def get_data(self) -> str: + """Get the stored data value.""" + return self._store._get_val(self._key) + def remove(self) -> bool: """Remove the current entry from the store.""" return self._store.remove(self.full_key) -- 2.39.5