summaryrefslogtreecommitdiffstats
path: root/geo-replication/syncdaemon/gsyncdconfig.py
diff options
context:
space:
mode:
authorShwetha K Acharya <sacharya@redhat.com>2019-07-02 15:00:25 +0530
committerKotresh HR <khiremat@redhat.com>2019-10-22 18:20:27 +0530
commit57510c2a28de017a147dc7fd8d95e2794a519714 (patch)
treedcc884ccde1d5ca16406c526146aead00ca3d4ed /geo-replication/syncdaemon/gsyncdconfig.py
parentb7f1d937d3de45558a4da35792e4546368f4d34a (diff)
geo-rep: Test case for upgrading config file
Added test case for the patch https://review.gluster.org/#/c/glusterfs/+/22894/4 Also updated if else structure in gsyncdconfig.py to avoid repeated occurance of values in new configfile. Backport of: > Patch: https://review.gluster.org/22982 > BUG: 1707731 > Change-Id: If97e1d37ac52dbd17d47be6cb659fc5a3ccab6d7 > Signed-off-by: Shwetha K Acharya <sacharya@redhat.com> fixes: bz#1764171 Change-Id: If97e1d37ac52dbd17d47be6cb659fc5a3ccab6d7 Signed-off-by: Kotresh HR <khiremat@redhat.com>
Diffstat (limited to 'geo-replication/syncdaemon/gsyncdconfig.py')
-rw-r--r--geo-replication/syncdaemon/gsyncdconfig.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/geo-replication/syncdaemon/gsyncdconfig.py b/geo-replication/syncdaemon/gsyncdconfig.py
index 68d1b489e23..0476d5ec05c 100644
--- a/geo-replication/syncdaemon/gsyncdconfig.py
+++ b/geo-replication/syncdaemon/gsyncdconfig.py
@@ -356,15 +356,14 @@ def config_upgrade(config_file, ret):
new_value = "tarssh"
else:
new_value = "rsync"
- config.set('vars', new_key, new_value)
-
- if key == "timeout":
+ config.set('vars', new_key, new_value)
+ elif key == "timeout":
new_key = "slave-timeout"
config.set('vars', new_key, value)
-
#for changes like: ignore_deletes to ignore-deletes
- new_key = key.replace("_", "-")
- config.set('vars', new_key, value)
+ else:
+ new_key = key.replace("_", "-")
+ config.set('vars', new_key, value)
with open(config_file, 'w') as configfile:
config.write(configfile)