]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephfs-shell: don't use pkg_resources since its deprecated 58085/head
authorRishabh Dave <ridave@redhat.com>
Thu, 22 Feb 2024 12:31:59 +0000 (18:01 +0530)
committerRishabh Dave <ridave@redhat.com>
Mon, 17 Jun 2024 11:58:25 +0000 (17:28 +0530)
Currently, cephfs-shell prints warnings, hangs and aborts when launched.
This occurs because Python module "pkg_resources" has been deprecated.
We use that module only checking version of other Python modules used in
cephfs-shell. Use "Version" from "packaging.version" instead.

Fixes: https://tracker.ceph.com/issues/64538
Signed-off-by: Rishabh Dave <ridave@redhat.com>
(cherry picked from commit 68b5766be9b0d88a6c2c78e267bdf0128bf6cec5)

src/tools/cephfs/shell/cephfs-shell

index b93f41e90b0d67adfa180b067601d0475608337c..9449007a80b9749c7a9007b106b4f85310cb070c 100755 (executable)
@@ -16,13 +16,12 @@ import shlex
 import stat
 import errno
 
-from pkg_resources import packaging  # type: ignore
-
 from cmd2 import Cmd
 from cmd2 import __version__ as cmd2_version
+from packaging.version import Version
+
 # XXX: In cmd2 versions < 1.0.1, we'll get SystemExit(2) instead of
 # Cmd2ArgparseError
-Version = packaging.version.Version
 if Version(cmd2_version) >= Version("1.0.1"):
     from cmd2.exceptions import Cmd2ArgparseError
 else: