diff options
author | John Mulligan <jmulligan@redhat.com> | 2023-12-13 20:33:20 +0100 |
---|---|---|
committer | John Mulligan <jmulligan@redhat.com> | 2024-03-21 23:30:58 +0100 |
commit | 07b44900e8c8bef434e848bf7aa84d18d78d8bd6 (patch) | |
tree | 5d44ce4b9bdb2bd223cd5d6bd185861ec29a958d /src/pybind/mgr/cephadm/utils.py | |
parent | cephadm: fix issue joining to ad by using a virtual hostname (diff) | |
download | ceph-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.py | 3 |
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: """ |