diff options
| author | Csaba Henk <csaba@gluster.com> | 2011-03-10 00:39:47 +0000 | 
|---|---|---|
| committer | Vijay Bellur <vijay@dev.gluster.com> | 2011-03-10 07:39:13 -0800 | 
| commit | cbdf22d79ada40e483583a4277aba2faaa769892 (patch) | |
| tree | 8fb664b7ca599da5f65e61edc7a6a1c3f9014099 | |
| parent | f9a982f30922d812097a70b87628a590b2f51f15 (diff) | |
syncdaemon: add versioning to config file
Signed-off-by: Kaushik BV <kaushikbv@gluster.com>
Signed-off-by: Vijay Bellur <vijay@dev.gluster.com>
BUG: 2427 (set a proper default for remote syncdaemon)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2427
| -rw-r--r-- | xlators/features/marker/utils/syncdaemon/configinterface.py | 11 | 
1 files changed, 6 insertions, 5 deletions
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')  | 
