]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: catch protobuf error due to mismatch in version 64613/head
authorNizamudeen A <nia@redhat.com>
Thu, 26 Jun 2025 07:25:22 +0000 (12:55 +0530)
committerNizamudeen A <nia@redhat.com>
Tue, 22 Jul 2025 03:53:18 +0000 (09:23 +0530)
Signed-off-by: Nizamudeen A <nia@redhat.com>
(cherry picked from commit acb0f19c4a50b2ea68f328a61a14a2da06be298b)

 Conflicts:
src/pybind/mgr/dashboard/services/nvmeof_client.py
 - only kept relavant portion applicable for squid

src/pybind/mgr/dashboard/services/nvmeof_client.py

index e0ea6d1e48b35191e999e16f51fcc51d331ce018..be2b5edbaa526c9c9f782ed6e3781bb174241c49 100644 (file)
@@ -1,3 +1,5 @@
+# pylint: disable=unexpected-keyword-arg
+
 import functools
 import logging
 from collections.abc import Iterable
@@ -9,6 +11,14 @@ from .nvmeof_conf import NvmeofGatewaysConfig
 logger = logging.getLogger("nvmeof_client")
 
 try:
+    # if the protobuf version is newer than what we generated with
+    # proto file import will fail (because of differences between what's
+    # available in centos and ubuntu).
+    # this "hack" should be removed once we update both the
+    # distros; centos and ubuntu.
+    import os
+    os.environ["PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION"] = "python"
+
     import grpc  # type: ignore
     import grpc._channel  # type: ignore
     from google.protobuf.message import Message  # type: ignore