summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorCsaba Henk <csaba@gluster.com>2011-04-29 06:24:42 +0000
committerAnand Avati <avati@gluster.com>2011-05-09 13:26:55 -0700
commita8addec412a7d6816e06dbbef2e14022edc6ec39 (patch)
treea003bbe461d89c4cc81f11423d40d5a15430b3cf /xlators
parentfa445b44c66eeebc09a3df74d5e924037a3d89c6 (diff)
syncdaemon: add --normalize-url option
Signed-off-by: Csaba Henk <csaba@gluster.com> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 2828 (gluster geo-rep stop should not show unsuccessful when the status is corrupt) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2828
Diffstat (limited to 'xlators')
-rw-r--r--xlators/features/marker/utils/syncdaemon/gsyncd.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/xlators/features/marker/utils/syncdaemon/gsyncd.py b/xlators/features/marker/utils/syncdaemon/gsyncd.py
index 60980f54659..963e7101bf4 100644
--- a/xlators/features/marker/utils/syncdaemon/gsyncd.py
+++ b/xlators/features/marker/utils/syncdaemon/gsyncd.py
@@ -162,8 +162,9 @@ def main_i():
callback=store_local_obj('del', lambda vx: {'opt': vx, 'rx': rx}))
conf_mod_opt_regex_variant(not not m)
- op.add_option('--canonicalize-url', dest='do_canon', action='callback', callback=store_local_curry('raw'))
- op.add_option('--canonicalize-escape-url', dest='do_canon', action='callback', callback=store_local_curry('escaped'))
+ op.add_option('--normalize-url', dest='url_print', action='callback', callback=store_local_curry('normal'))
+ op.add_option('--canonicalize-url', dest='url_print', action='callback', callback=store_local_curry('canon'))
+ op.add_option('--canonicalize-escape-url', dest='url_print', action='callback', callback=store_local_curry('canon_esc'))
tunables = [ norm(o.get_opt_string()[2:]) for o in op.option_list if o.callback in (store_abs, None) and o.get_opt_string() not in ('--version', '--help') ]
@@ -177,7 +178,7 @@ def main_i():
if not (len(args) == 2 or \
(len(args) == 1 and rconf.get('listen')) or \
(len(args) <= 2 and confdata) or \
- rconf.get('do_canon')):
+ rconf.get('url_print')):
sys.stderr.write("error: incorrect number of arguments\n\n")
sys.stderr.write(op.get_usage() + "\n")
sys.exit(1)
@@ -188,10 +189,12 @@ def main_i():
namedict = {}
else:
rscs = [resource.parse_url(u) for u in args]
- dc = rconf.get('do_canon')
+ dc = rconf.get('url_print')
if dc:
for r in rscs:
- print(r.get_url(canonical=True, escaped=(dc=='escaped')))
+ print(r.get_url(**{'normal': {},
+ 'canon': {'canonical': True},
+ 'canon_esc': {'canonical': True, 'escaped': True}}[dc]))
return
local = remote = None
if rscs: