From f31ff28a3e75e6a8516ed4eaa6fb5c56ce4002b1 Mon Sep 17 00:00:00 2001 From: nnDarshan Date: Thu, 30 Mar 2017 18:09:19 +0530 Subject: [PATCH 1/3] Use tags defined in master.yml for updating tags This patch removes the locally hardcoded tag details and instead uses the globally defined tag details in the master.yml Signed-off-by: nnDarshan --- tendrl/node_agent/node_sync/__init__.py | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/tendrl/node_agent/node_sync/__init__.py b/tendrl/node_agent/node_sync/__init__.py index 7a3bfb23..03d3e9bd 100644 --- a/tendrl/node_agent/node_sync/__init__.py +++ b/tendrl/node_agent/node_sync/__init__.py @@ -25,17 +25,6 @@ "ceph-osd@*" ] -TENDRL_SERVICE_TAGS = { - "tendrl-node-agent": "tendrl/node", - "etcd": "tendrl/central-store", - "tendrl-apid": "tendrl/server", - "tendrl-gluster-integration": "tendrl/integration/gluster", - "tendrl-ceph-integration": "tendrl/integration/ceph", - "glusterd": "gluster/server", - "ceph-mon": "ceph/mon", - "ceph-osd": "ceph/osd" -} - class NodeAgentSyncThread(sds_sync.StateSyncThread): def _run(self): @@ -68,7 +57,10 @@ def _run(self): for service in TENDRL_SERVICES: s = NS.tendrl.objects.Service(service=service) if s.running: - tags.append(TENDRL_SERVICE_TAGS[service.strip("@*")]) + service_tag = NS.compiled_definitions.get_parsed_defs()[ + 'namespace.tendrl' + ]['tags'][service.strip("@*")] + tags.append(service_tag) s.save() gevent.sleep(interval) From ab70678f45ee14c267a12669dd4ffa34eb82ee12 Mon Sep 17 00:00:00 2001 From: Rohan Kanade Date: Thu, 30 Mar 2017 18:37:52 +0530 Subject: [PATCH 2/3] Update __init__.py --- tendrl/node_agent/node_sync/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tendrl/node_agent/node_sync/__init__.py b/tendrl/node_agent/node_sync/__init__.py index 7a3bfb23..c61e809d 100644 --- a/tendrl/node_agent/node_sync/__init__.py +++ b/tendrl/node_agent/node_sync/__init__.py @@ -49,7 +49,7 @@ def _run(self): while not self._complete.is_set(): try: priority = "debug" - interval = 10 + interval = 2 if NS.first_node_inventory_sync: priority = "info" interval = 2 From 398161819a164a85d0f29f705806a451e4d75699 Mon Sep 17 00:00:00 2001 From: Rohan Kanade Date: Thu, 30 Mar 2017 18:38:04 +0530 Subject: [PATCH 3/3] Update __init__.py --- tendrl/node_agent/node_sync/__init__.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tendrl/node_agent/node_sync/__init__.py b/tendrl/node_agent/node_sync/__init__.py index c61e809d..63d899ce 100644 --- a/tendrl/node_agent/node_sync/__init__.py +++ b/tendrl/node_agent/node_sync/__init__.py @@ -52,7 +52,6 @@ def _run(self): interval = 2 if NS.first_node_inventory_sync: priority = "info" - interval = 2 NS.first_node_inventory_sync = False gevent.sleep(interval)