From: Venky Shankar Date: Thu, 28 Sep 2023 07:54:35 +0000 (+0530) Subject: cephfs-shell: use pkg_resources rather than packaging module X-Git-Tag: v19.0.0~255^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7f7858748d39510a0d699f91df74a17ec9f4ff3d;p=ceph.git cephfs-shell: use pkg_resources rather than packaging module `pkg_resources` is already being used by other py scripts. Fixes: https://tracker.ceph.com/issues/62739 Signed-off-by: Venky Shankar --- diff --git a/src/tools/cephfs/shell/cephfs-shell b/src/tools/cephfs/shell/cephfs-shell index bdd1bb4f0b2b..d1726940ffde 100755 --- a/src/tools/cephfs/shell/cephfs-shell +++ b/src/tools/cephfs/shell/cephfs-shell @@ -16,13 +16,14 @@ import shlex import stat import errno -from packaging import version +from pkg_resources import packaging # type: ignore from cmd2 import Cmd from cmd2 import __version__ as cmd2_version # XXX: In cmd2 versions < 1.0.1, we'll get SystemExit(2) instead of # Cmd2ArgparseError -if version.parse(cmd2_version) >= version.parse("1.0.1"): +Version = packaging.version.Version +if Version(cmd2_version) >= Version("1.0.1"): from cmd2.exceptions import Cmd2ArgparseError else: # HACK: so that we don't have check for version everywhere