diff options
Diffstat (limited to 'tools/glusterfind/src/utils.py')
-rw-r--r-- | tools/glusterfind/src/utils.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tools/glusterfind/src/utils.py b/tools/glusterfind/src/utils.py index fdf61fe0f9e..b3b0bdfffa3 100644 --- a/tools/glusterfind/src/utils.py +++ b/tools/glusterfind/src/utils.py @@ -1,4 +1,5 @@ #!/usr/bin/env python +# -*- coding: utf-8 -*- # Copyright (c) 2015 Red Hat, Inc. <http://www.redhat.com/> # This file is part of GlusterFS. @@ -228,14 +229,17 @@ def get_changelog_rollover_time(volumename): return DEFAULT_CHANGELOG_INTERVAL -def output_path_prepare(path, output_prefix): +def output_path_prepare(path, args): """ If Prefix is set, joins to Path, removes ending slash and encodes it. """ - if output_prefix != ".": - path = os.path.join(output_prefix, path) + if args.output_prefix != ".": + path = os.path.join(args.output_prefix, path) if path.endswith("/"): path = path[0:len(path)-1] - return urllib.quote_plus(path) + if args.no_encode: + return path + else: + return urllib.quote_plus(path) |