From: Redouane Kachach Date: Tue, 29 Mar 2022 16:37:10 +0000 (+0200) Subject: mgr/cephadm: fallback to normal sorted if cannot import natsorted X-Git-Tag: v18.0.0~1159^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=19c07de8207de5038df6f510a3c2ff41b10f7e08;p=ceph.git mgr/cephadm: fallback to normal sorted if cannot import natsorted Fixes: https://tracker.ceph.com/issues/55113 Signed-off-by: Redouane Kachach --- diff --git a/src/pybind/mgr/orchestrator/module.py b/src/pybind/mgr/orchestrator/module.py index 04d57fbe1f86..efa49c3adc40 100644 --- a/src/pybind/mgr/orchestrator/module.py +++ b/src/pybind/mgr/orchestrator/module.py @@ -7,7 +7,12 @@ import datetime import yaml from prettytable import PrettyTable -from natsort import natsorted + +try: + from natsort import natsorted +except ImportError: + # fallback to normal sort + natsorted = sorted # type: ignore from ceph.deployment.inventory import Device from ceph.deployment.drive_group import DriveGroupSpec, DeviceSelection, OSDMethod