From 689f157e818910eca32aba91b0eadf3648d87cd5 Mon Sep 17 00:00:00 2001 From: John Mulligan Date: Wed, 13 Dec 2023 14:33:20 -0500 Subject: [PATCH] mgr/cephadm: fix test failure on newer python Tests that touch this enum fail for me locally but pass in the CI. This seems to be due to new enum related behavior in Python 3.11. See: https://blog.pecar.me/python-enum Instead of fixing it as suggested in the above blog, adding a __str__ method works on all python versions I care to know about. Signed-off-by: John Mulligan (cherry picked from commit a30cbabefe15022284f9e6b6316a204879a17fc0) --- src/pybind/mgr/cephadm/utils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pybind/mgr/cephadm/utils.py b/src/pybind/mgr/cephadm/utils.py index 3aedfbd86f0..1ba3e48454a 100644 --- a/src/pybind/mgr/cephadm/utils.py +++ b/src/pybind/mgr/cephadm/utils.py @@ -57,6 +57,9 @@ class SpecialHostLabels(str, Enum): def to_json(self) -> str: return self.value + def __str__(self) -> str: + return self.value + def name_to_config_section(name: str) -> ConfEntity: """ -- 2.39.5