summaryrefslogtreecommitdiffstats
path: root/src/pybind/mgr/cephadm/utils.py
diff options
context:
space:
mode:
authorJohn Mulligan <jmulligan@redhat.com>2023-12-13 20:33:20 +0100
committerJohn Mulligan <jmulligan@redhat.com>2024-03-21 23:30:58 +0100
commit07b44900e8c8bef434e848bf7aa84d18d78d8bd6 (patch)
tree5d44ce4b9bdb2bd223cd5d6bd185861ec29a958d /src/pybind/mgr/cephadm/utils.py
parentcephadm: fix issue joining to ad by using a virtual hostname (diff)
downloadceph-07b44900e8c8bef434e848bf7aa84d18d78d8bd6.tar.xz
ceph-07b44900e8c8bef434e848bf7aa84d18d78d8bd6.zip
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 <jmulligan@redhat.com>
Diffstat (limited to 'src/pybind/mgr/cephadm/utils.py')
-rw-r--r--src/pybind/mgr/cephadm/utils.py3
1 files changed, 3 insertions, 0 deletions
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:
"""