]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: fallback to normal sorted if cannot import natsorted 45692/head
authorRedouane Kachach <rkachach@redhat.com>
Tue, 29 Mar 2022 16:37:10 +0000 (18:37 +0200)
committerRedouane Kachach <rkachach@redhat.com>
Tue, 29 Mar 2022 17:08:10 +0000 (19:08 +0200)
Fixes: https://tracker.ceph.com/issues/55113
Signed-off-by: Redouane Kachach <rkachach@redhat.com>
src/pybind/mgr/orchestrator/module.py

index 04d57fbe1f8659f081722d219f8f4f5221464fd8..efa49c3adc404b35d616998d2a3c79e8c930c970 100644 (file)
@@ -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