summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorRamesh Nachimuthu <rnachimu@redhat.com>2014-06-16 14:47:41 +0530
committerSahina Bose <sabose@redhat.com>2014-06-16 06:16:35 -0700
commitc2a1a415c51be10903cfabdd69e0239fc4936701 (patch)
tree24d1c4ea37032678156f619ef78fbbbe69339bfb /plugins
parentda82641c100a4e21d00d823a1dfdbc4eb068b1a2 (diff)
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 <rnachimu@redhat.com> Reviewed-on: http://review.gluster.org/8074 Reviewed-by: Sahina Bose <sabose@redhat.com> Tested-by: Sahina Bose <sabose@redhat.com>
Diffstat (limited to 'plugins')
-rwxr-xr-xplugins/discovery.py10
1 files 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):