From 6d9d04248ea574ffbe94edec9e552232924eb8ff Mon Sep 17 00:00:00 2001 From: Ramesh Nachimuthu Date: Thu, 24 Apr 2014 17:45:25 +0530 Subject: autoconf: use host uuid to indentity bricks Using host UUIDs to bricks in host Change-Id: Ie5467b05391f709e292644f00495b41af8213b42 Signed-off-by: Ramesh Nachimuthu --- plugins/config_generator.py | 2 +- plugins/discovery.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'plugins') diff --git a/plugins/config_generator.py b/plugins/config_generator.py index 2bfffdf..6ba1631 100644 --- a/plugins/config_generator.py +++ b/plugins/config_generator.py @@ -171,7 +171,7 @@ class GlusterNagiosConfManager: clusterServices.append(self.createClusterUtilizationService( cluster['name'])) clusterServices.append(self.createClusterAutoConfigService( - cluster['name'], cluster['hosts'][-1]['hostip'])) + cluster['name'], cluster['hosts'][0]['hostip'])) clusterHostConfig = self.createHost( cluster['name'], cluster['name'], "gluster-cluster", cluster['name'], None, None, clusterServices) diff --git a/plugins/discovery.py b/plugins/discovery.py index 3818a84..b2cc21a 100755 --- a/plugins/discovery.py +++ b/plugins/discovery.py @@ -55,7 +55,7 @@ def discoverCluster(hostip, cluster): hostlist = excecNRPECommand(hostip, "discoverpeers") #Add the ip address of the root node to the peer list #to generate the configuration - hostlist.append({"hostip": hostip}) + hostlist[0]['hostip'] = hostip for host in hostlist: #Get host names hostDetails = excecNRPECommand(host['hostip'], "discoverhostparams") @@ -64,7 +64,7 @@ def discoverCluster(hostip, cluster): host['bricks'] = [] for volume in componentlist['volumes']: for brick in volume['bricks']: - if brick['hostip'] == host['hostip']: + if brick['hostUuid'] == host['uuid']: brick['volumeName'] = volume['name'] host['bricks'].append(brick) clusterdata['hosts'] = hostlist -- cgit