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)
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: