From 4e7b4ec23793caaae05b1e0e7665e59bf7a607b1 Mon Sep 17 00:00:00 2001 From: Ramesh Nachimuthu Date: Wed, 21 May 2014 15:54:41 +0530 Subject: autoConfig: create quota/geo rep services conditionally Create QUOTA and GEO Replication status services for volume only when respective services are enabled in gluster. Bug-Url: https://bugzilla.redhat.com/1099731 Change-Id: I9813a64f7d2573aaf3b23534643662e198b5457d Signed-off-by: Ramesh Nachimuthu Reviewed-on: http://review.gluster.org/7838 Reviewed-by: Sahina Bose --- plugins/config_generator.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'plugins') diff --git a/plugins/config_generator.py b/plugins/config_generator.py index 8466c83..acb7fff 100644 --- a/plugins/config_generator.py +++ b/plugins/config_generator.py @@ -155,18 +155,20 @@ class GlusterNagiosConfManager: volumeService = self.__createVolumeUtilizationService(volume, clusterName) volumeServices.append(volumeService) - volumeService = self.__createVolumeQuotaStatusService(volume, - clusterName) - volumeServices.append(volumeService) + if volume.get('quota') == "on": + volumeService = self.__createVolumeQuotaStatusService( + volume, clusterName) + volumeServices.append(volumeService) + if 'REPLICATE' in volume['type'].upper(): - volumeService = (self. - __createVolumeHealStatusService(volume, - clusterName)) + volumeService = self.__createVolumeHealStatusService( + volume, clusterName) volumeServices.append(volumeService) - volumeService = (self. - __createVolumeGeoRepStatusService(volume, - clusterName)) - volumeServices.append(volumeService) + if volume.get('geo-rep') == "on": + volumeService = self.__createVolumeGeoRepStatusService( + volume, clusterName) + volumeServices.append(volumeService) + volumeService = self.__createVolumeStatusService(volume, clusterName) volumeServices.append(volumeService) -- cgit