]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/smb: extend the mon key store to support raw data
authorJohn Mulligan <jmulligan@redhat.com>
Tue, 1 Jul 2025 21:14:55 +0000 (17:14 -0400)
committerAdam King <adking@redhat.com>
Thu, 21 Aug 2025 18:13:55 +0000 (14:13 -0400)
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 <jmulligan@redhat.com>
(cherry picked from commit 8254069dba53d6bf50a76a087a692ea633a60736)

src/pybind/mgr/smb/mon_store.py

index 1bea3a7200b8315f476410d4a0059ff910de00be..58700f1c4e11cb1bf8fa236e0383b6d9537cf9f8 100644 (file)
@@ -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)