From: Alexander Indenbaum Date: Thu, 12 Sep 2024 09:26:34 +0000 (+0000) Subject: pybind/mgr/cephadm/services/nvmeof.py: allow setting '0.0.0.0' as address in the... X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=fe60519755fecbd05feec3c5bc9829bb706557ef;p=ceph-ci.git pybind/mgr/cephadm/services/nvmeof.py: allow setting '0.0.0.0' as address in the spec file - Partial revert of https://github.com/ceph/ceph/pull/59738/commits/9eb3b99b99b0b8c6c4e5f75e59c2e4835a9d6796 - Part of https://github.com/ceph/ceph/pull/59738 (cherry picked from commit 62a4247353dd85417303995cda7e9b8ffae1e929) python-common/ceph/deployment/service_spec.py: Allow the cephadm deployment to determine the default addresses Signed-off-by: Alexander Indenbaum (cherry picked from commit 0997e4cd51edfe954148bfb8b7f42be9205c237c) Resolves: rhbz#2311996 (cherry picked from commit 2db75595f1c44f5fb973a612a08406b5630ad1e5) --- diff --git a/src/pybind/mgr/cephadm/services/nvmeof.py b/src/pybind/mgr/cephadm/services/nvmeof.py index 1f0c6cbfaf7..7ca3f9d42ce 100644 --- a/src/pybind/mgr/cephadm/services/nvmeof.py +++ b/src/pybind/mgr/cephadm/services/nvmeof.py @@ -47,12 +47,8 @@ class NvmeofService(CephService): transport_tcp_options = json.dumps(spec.transport_tcp_options) if spec.transport_tcp_options else None name = '{}.{}'.format(utils.name_to_config_section('nvmeof'), nvmeof_gw_id) rados_id = name[len('client.'):] if name.startswith('client.') else name - addr = host_ip - discovery_addr = host_ip - if spec.addr and spec.addr != "0.0.0.0": - addr = spec.addr - if spec.discovery_addr and spec.discovery_addr != "0.0.0.0": - discovery_addr = spec.discovery_addr + addr = spec.addr or host_ip + discovery_addr = spec.discovery_addr or host_ip context = { 'spec': spec, 'name': name, diff --git a/src/python-common/ceph/deployment/service_spec.py b/src/python-common/ceph/deployment/service_spec.py index 18a27eab664..9d2fd64d7d1 100644 --- a/src/python-common/ceph/deployment/service_spec.py +++ b/src/python-common/ceph/deployment/service_spec.py @@ -1380,7 +1380,7 @@ class NvmeofServiceSpec(ServiceSpec): #: RADOS pool where ceph-nvmeof config data is stored. self.pool = pool #: ``addr`` address of the nvmeof gateway - self.addr = addr or "0.0.0.0" + self.addr = addr #: ``port`` port of the nvmeof gateway self.port = port or 5500 #: ``name`` name of the nvmeof gateway