From ff2a58d784bc20ccafab8183d82787ceb8ac471b Mon Sep 17 00:00:00 2001 From: Aravinda VK Date: Mon, 12 Dec 2016 13:06:15 +0530 Subject: geo-rep: Fix log-rsync-performance config issue If log-rsync-performance config is not set, gconf.get_realtime will return None, Added default value as False if config file doesn't have this option set. BUG: 1393678 Change-Id: I89016ab480a16179db59913d635d8553beb7e14f Signed-off-by: Aravinda VK Reviewed-on: http://review.gluster.org/16102 Smoke: Gluster Build System Tested-by: Kotresh HR Reviewed-by: Kotresh HR NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System --- geo-replication/syncdaemon/resource.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'geo-replication/syncdaemon/resource.py') diff --git a/geo-replication/syncdaemon/resource.py b/geo-replication/syncdaemon/resource.py index 37b9043fc88..3722d21a0fd 100644 --- a/geo-replication/syncdaemon/resource.py +++ b/geo-replication/syncdaemon/resource.py @@ -1037,8 +1037,10 @@ class SlaveRemote(object): (boolify(gconf.sync_acls) and ['--acls'] or []) + \ ['.'] + list(args) - if boolify(gconf.configinterface.get_realtime( - "log_rsync_performance")): + log_rsync_performance = boolify(gconf.configinterface.get_realtime( + "log_rsync_performance", default_value=False)) + + if log_rsync_performance: # use stdout=PIPE only when log_rsync_performance enabled # Else rsync will write to stdout and nobody is their # to consume. If PIPE is full rsync hangs. @@ -1057,8 +1059,7 @@ class SlaveRemote(object): for errline in stderr.strip().split("\n")[:-1]: logging.error("SYNC Error(Rsync): %s" % errline) - if boolify(gconf.configinterface.get_realtime( - "log_rsync_performance")): + if log_rsync_performance: rsync_msg = [] for line in stdout.split("\n"): if line.startswith("Number of files:") or \ -- cgit