From c2a1a415c51be10903cfabdd69e0239fc4936701 Mon Sep 17 00:00:00 2001 From: Ramesh Nachimuthu Date: Mon, 16 Jun 2014 14:47:41 +0530 Subject: autoconfig: fixing issue in finding duplicate hosts When a host is in disconnected status, we will not communicate with the host and will not be able to get the hostname. So we don't need to consider those disconnected hosts in finding duplicate hosts. Change-Id: Ie3fbef03635d46fd9d95e5b1f4df7435e800c55d Bug-Url: https://bugzilla.redhat.com/1109723 Signed-off-by: Ramesh Nachimuthu Reviewed-on: http://review.gluster.org/8074 Reviewed-by: Sahina Bose Tested-by: Sahina Bose --- plugins/discovery.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/plugins/discovery.py b/plugins/discovery.py index e236842..90a9e50 100755 --- a/plugins/discovery.py +++ b/plugins/discovery.py @@ -490,10 +490,12 @@ def _getHostGroupNames(hostConfig): def _findDuplicateHost(hosts, clusterName): for host in hosts: - hostConfig = server_utils.getHostConfigByName(host.get('hostname')) - if hostConfig: - if clusterName not in _getHostGroupNames(hostConfig): - return host.get('hostname') + #Host name may be empty if the host is in disconnected status + if host.get('hostname'): + hostConfig = server_utils.getHostConfigByName(host.get('hostname')) + if hostConfig: + if clusterName not in _getHostGroupNames(hostConfig): + return host.get('hostname') def getRemovedHostsCount(clusterDelta): -- cgit