From 95eff049d4475f6eb5837cd853206b1222cfcd7e Mon Sep 17 00:00:00 2001 From: Venky Shankar Date: Thu, 28 Sep 2023 13:24:35 +0530 Subject: [PATCH] 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 (cherry picked from commit 7f7858748d39510a0d699f91df74a17ec9f4ff3d) --- src/tools/cephfs/shell/cephfs-shell | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/tools/cephfs/shell/cephfs-shell b/src/tools/cephfs/shell/cephfs-shell index f8e57605070..ec78d111c95 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 -- 2.47.3