diff options
author | Sebastian Wagner <sebastian.wagner@suse.com> | 2019-12-13 17:29:35 +0100 |
---|---|---|
committer | Sebastian Wagner <sebastian.wagner@suse.com> | 2019-12-13 17:29:35 +0100 |
commit | 074adad5c49479d8fb8e163a0e429baae52cce8c (patch) | |
tree | b02906028dcabf459a9c2d9d09139206107f911f /src/pybind/mgr/orchestrator.py | |
parent | mgr/ansible: Integrate mgr/ansible/tox into mgr/tox (diff) | |
download | ceph-074adad5c49479d8fb8e163a0e429baae52cce8c.tar.xz ceph-074adad5c49479d8fb8e163a0e429baae52cce8c.zip |
mgr/orchestrator: Add __str__ to HostSpec
As requested by mypy
Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
Diffstat (limited to 'src/pybind/mgr/orchestrator.py')
-rw-r--r-- | src/pybind/mgr/orchestrator.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/pybind/mgr/orchestrator.py b/src/pybind/mgr/orchestrator.py index 27d3b8f3d35..169e8e2585f 100644 --- a/src/pybind/mgr/orchestrator.py +++ b/src/pybind/mgr/orchestrator.py @@ -34,7 +34,15 @@ except ImportError: logger = logging.getLogger(__name__) -HostSpec = namedtuple('HostSpec', ['hostname', 'network', 'name']) +class HostSpec(namedtuple('HostSpec', ['hostname', 'network', 'name'])): + def __str__(self): + res = '' + res += self.hostname + if self.network: + res += ':' + self.network + if self.name: + res += '=' + self.name + return res def parse_host_specs(host, require_network=True): |