From 19c07de8207de5038df6f510a3c2ff41b10f7e08 Mon Sep 17 00:00:00 2001 From: Redouane Kachach Date: Tue, 29 Mar 2022 18:37:10 +0200 Subject: [PATCH] mgr/cephadm: fallback to normal sorted if cannot import natsorted Fixes: https://tracker.ceph.com/issues/55113 Signed-off-by: Redouane Kachach --- src/pybind/mgr/orchestrator/module.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/pybind/mgr/orchestrator/module.py b/src/pybind/mgr/orchestrator/module.py index 04d57fbe1f8..efa49c3adc4 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 -- 2.47.3