From cbdf22d79ada40e483583a4277aba2faaa769892 Mon Sep 17 00:00:00 2001 From: Csaba Henk Date: Thu, 10 Mar 2011 00:39:47 +0000 Subject: syncdaemon: add versioning to config file Signed-off-by: Kaushik BV Signed-off-by: Vijay Bellur BUG: 2427 (set a proper default for remote syncdaemon) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2427 --- xlators/features/marker/utils/syncdaemon/configinterface.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'xlators') diff --git a/xlators/features/marker/utils/syncdaemon/configinterface.py b/xlators/features/marker/utils/syncdaemon/configinterface.py index f0efc1df861..b0aa93f4258 100644 --- a/xlators/features/marker/utils/syncdaemon/configinterface.py +++ b/xlators/features/marker/utils/syncdaemon/configinterface.py @@ -11,6 +11,8 @@ except ImportError: import urllib SECT_ORD = '__section_order__' +SECT_META = '__meta__' +config_version = 2.0 re_type = type(re.compile('')) @@ -67,11 +69,7 @@ class GConffile(object): tv = 0 if so2: tv = max(so2.values()) + 1 - ss = self.config.sections() - try: - ss.remove(SECT_ORD) - except ValueError: - pass + ss = [s for s in self.config.sections() if s.find('__') != 0] for s in ss: if s in so.keys(): continue @@ -115,6 +113,9 @@ class GConffile(object): print("%s: %s" % (k, v)) def write(self): + if not self.config.has_section(SECT_META): + self.config.add_section(SECT_META) + self.config.set(SECT_META, 'version', config_version) f = None try: f = open(self.path, 'wb') -- cgit