diff options
author | Csaba Henk <csaba@gluster.com> | 2011-02-07 20:42:23 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2011-02-10 22:17:50 -0800 |
commit | ebd7e1771c69a056f0456ff2dccac4319806f63b (patch) | |
tree | 8fe942f33f9928e176cb55c9c2b9b85d6181d3eb /xlators/features/marker/utils/syncdaemon/gsyncd.py | |
parent | d6363c595ace12a1bf9060dcd76a9e88e58d3db0 (diff) |
syncdaemon: config revamp #2: implement canonicalized urls, use them in config file sections
Signed-off-by: Csaba Henk <csaba@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 1570 (geosync related changes)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1570
Diffstat (limited to 'xlators/features/marker/utils/syncdaemon/gsyncd.py')
-rw-r--r-- | xlators/features/marker/utils/syncdaemon/gsyncd.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/xlators/features/marker/utils/syncdaemon/gsyncd.py b/xlators/features/marker/utils/syncdaemon/gsyncd.py index d02b05d0c31..c414c2a9c1b 100644 --- a/xlators/features/marker/utils/syncdaemon/gsyncd.py +++ b/xlators/features/marker/utils/syncdaemon/gsyncd.py @@ -194,14 +194,20 @@ def main_i(): remote = resource.parse_url(args[1]) if not local.can_connect_to(remote): raise RuntimeError("%s cannot work with %s" % (local.path, remote and remote.path)) - peers = [x.url for x in [local, remote] if x] + pa = ([], []) + canon = [False, True] + for x in (local, remote): + if x: + for i in range(2): + pa[i].append(x.get_url(canonical=canon[i])) + peers, canon_peers = pa gconf.__dict__.update(defaults.__dict__) if not 'config_file' in rconf: rconf['config_file'] = os.path.join(os.path.dirname(sys.argv[0]), "conf/gsyncd.conf") cfg = ConfigParser.RawConfigParser({}, dict) cfg.read(rconf['config_file']) - for sect in ('global', 'peers ' + ' '.join(peers)): + for sect in ('global', 'peers ' + ' '.join(canon_peers)): if cfg.has_section(sect): gconf.__dict__.update(cfg._sections[sect]) gconf.__dict__.update(opts.__dict__) |