From a37b8711efaca3ba1a46eb5a00b72159b8a2b128 Mon Sep 17 00:00:00 2001 From: zhuli Date: Mon, 11 Sep 2017 15:49:43 +0800 Subject: [PATCH] fix duplicated ntp configuration the ntp service will be configured again on existing nodes when scale a cluster, which turns out duplicated config at the end of '/etc/ntp.conf' and results in syntax error when restart ntp service. Change-Id: I3d59823474b44498e1d6961f328d9b9d6f795ed6 Closes-Bug: #1716307 --- sahara/service/ntp_service.py | 4 ++-- sahara/service/ops.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sahara/service/ntp_service.py b/sahara/service/ntp_service.py index 6b17bb3737..053e3b69c9 100644 --- a/sahara/service/ntp_service.py +++ b/sahara/service/ntp_service.py @@ -107,12 +107,12 @@ def retrieve_ntp_server_url(cluster): return cl_configs[target][name] -def configure_ntp(cluster_id): +def configure_ntp(cluster_id, instance_ids=None): cluster = conductor.cluster_get(context.ctx(), cluster_id) if not is_ntp_enabled(cluster): LOG.debug("Don't configure NTP on cluster") return - instances = c_u.get_instances(cluster) + instances = c_u.get_instances(cluster, instance_ids) url = retrieve_ntp_server_url(cluster) with context.ThreadGroup() as tg: for instance in instances: diff --git a/sahara/service/ops.py b/sahara/service/ops.py index ac272527f2..c578a84d92 100644 --- a/sahara/service/ops.py +++ b/sahara/service/ops.py @@ -341,7 +341,7 @@ def _provision_scaled_cluster(cluster_id, node_group_id_map): # Setting up new nodes with the plugin if instance_ids: - ntp_service.configure_ntp(cluster_id) + ntp_service.configure_ntp(cluster_id, instance_ids) cluster = c_u.change_cluster_status( cluster, c_u.CLUSTER_STATUS_CONFIGURING) instances = c_u.get_instances(cluster, instance_ids)