From: Jeff Layton Date: Thu, 17 Jan 2019 13:46:23 +0000 (-0500) Subject: mgr/orchestrator: change "daemon_name" field in ServiceDescription to be "service_ins... X-Git-Tag: v14.1.0~352^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=cb73bb19f0bff91b023a13a9995a4361dcdfb720;p=ceph.git mgr/orchestrator: change "daemon_name" field in ServiceDescription to be "service_instance" Signed-off-by: Jeff Layton --- diff --git a/src/pybind/mgr/deepsea/module.py b/src/pybind/mgr/deepsea/module.py index 29ef6ab38d0..344770be6e8 100644 --- a/src/pybind/mgr/deepsea/module.py +++ b/src/pybind/mgr/deepsea/module.py @@ -183,10 +183,10 @@ class DeepSeaOrchestrator(MgrModule, orchestrator.Orchestrator): result = [] if event_data['success']: for node_name, service_info in event_data["return"].items(): - for service_type, daemon_name in service_info.items(): + for service_type, service_instance in service_info.items(): desc = orchestrator.ServiceDescription() desc.nodename = node_name - desc.daemon_name = daemon_name + desc.service_instance = service_instance desc.service_type = service_type result.append(desc) return result diff --git a/src/pybind/mgr/orchestrator.py b/src/pybind/mgr/orchestrator.py index 4e234d17b7d..1c0855c8b04 100644 --- a/src/pybind/mgr/orchestrator.py +++ b/src/pybind/mgr/orchestrator.py @@ -410,7 +410,7 @@ class ServiceDescription(object): # typically either based on hostnames or on pod names. # This is the in mds., the ID that will appear # in the FSMap/ServiceMap. - self.daemon_name = None + self.service_instance = None # The type of service (osd, mon, mgr, etc.) self.service_type = None @@ -436,7 +436,7 @@ class ServiceDescription(object): out = { 'nodename': self.nodename, 'container_id': self.container_id, - 'daemon_name': self.daemon_name, + 'service_instance': self.service_instance, 'service_type': self.service_type, 'version': self.version, 'rados_config_location': self.rados_config_location, diff --git a/src/pybind/mgr/orchestrator_cli/module.py b/src/pybind/mgr/orchestrator_cli/module.py index 51b06a6c837..17aed322597 100644 --- a/src/pybind/mgr/orchestrator_cli/module.py +++ b/src/pybind/mgr/orchestrator_cli/module.py @@ -191,7 +191,7 @@ class OrchestratorCli(orchestrator.OrchestratorClientMixin, MgrModule): services = completion.result # Sort the list for display - services.sort(key=lambda s: (s.service_type, s.nodename, s.daemon_name)) + services.sort(key=lambda s: (s.service_type, s.nodename, s.service_instance)) if len(services) == 0: return HandleCommandResult(stdout="No services reported") @@ -203,7 +203,7 @@ class OrchestratorCli(orchestrator.OrchestratorClientMixin, MgrModule): for s in services: lines.append("{0}.{1} {2} {3} {4} {5}".format( s.service_type, - s.daemon_name, + s.service_instance, s.nodename, s.container_id, s.version, diff --git a/src/pybind/mgr/rook/module.py b/src/pybind/mgr/rook/module.py index 9e56c94d01e..cb9d2b053d2 100644 --- a/src/pybind/mgr/rook/module.py +++ b/src/pybind/mgr/rook/module.py @@ -346,16 +346,16 @@ class RookOrchestrator(MgrModule, orchestrator.Orchestrator): sd.service_type = p['labels']['app'].replace('rook-ceph-', '') if sd.service_type == "osd": - sd.daemon_name = "%s" % p['labels']["ceph-osd-id"] + sd.service_instance = "%s" % p['labels']["ceph-osd-id"] elif sd.service_type == "mds": - sd.daemon_name = p['labels']["rook_file_system"] + sd.service_instance = p['labels']["rook_file_system"] elif sd.service_type == "mon": - sd.daemon_name = p['labels']["mon"] + sd.service_instance = p['labels']["mon"] elif sd.service_type == "mgr": - sd.daemon_name = p['labels']["mgr"] + sd.service_instance = p['labels']["mgr"] elif sd.service_type == "nfs": - sd.daemon_name = p['labels']["ceph_nfs"] - sd.rados_config_location = self.rook_cluster.get_nfs_conf_url(sd.daemon_name, p['labels']['instance']) + sd.service_instance = p['labels']["ceph_nfs"] + sd.rados_config_location = self.rook_cluster.get_nfs_conf_url(sd.service_instance, p['labels']['instance']) else: # Unknown type -- skip it continue diff --git a/src/pybind/mgr/test_orchestrator/module.py b/src/pybind/mgr/test_orchestrator/module.py index 88b3391acd1..c9f540de8f0 100644 --- a/src/pybind/mgr/test_orchestrator/module.py +++ b/src/pybind/mgr/test_orchestrator/module.py @@ -238,7 +238,7 @@ class TestOrchestrator(MgrModule, orchestrator.Orchestrator): for p in processes: sd = orchestrator.ServiceDescription() sd.nodename = 'localhost' - sd.daemon_name = re.search('ceph-[^ ]+', p).group() + sd.service_instance = re.search('ceph-[^ ]+', p).group() result.append(sd) return result