diff options
author | Csaba Henk <csaba@gluster.com> | 2011-03-10 00:40:05 +0000 |
---|---|---|
committer | Vijay Bellur <vijay@dev.gluster.com> | 2011-03-10 07:39:17 -0800 |
commit | 50492481a2b1e5a1425598fb44d802ec047f6c2f (patch) | |
tree | 1c0ef7ab1a13e31fa707b76ba484f1c0e8471802 /xlators/features/marker/utils/syncdaemon/resource.py | |
parent | cbdf22d79ada40e483583a4277aba2faaa769892 (diff) |
syncdaemon: add support from dumping urls in canonical and escaped canonical form
Signed-off-by: Kaushik BV <kaushikbv@gluster.com>
Signed-off-by: Vijay Bellur <vijay@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/resource.py')
-rw-r--r-- | xlators/features/marker/utils/syncdaemon/resource.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/xlators/features/marker/utils/syncdaemon/resource.py b/xlators/features/marker/utils/syncdaemon/resource.py index efd136075..f002f0eb1 100644 --- a/xlators/features/marker/utils/syncdaemon/resource.py +++ b/xlators/features/marker/utils/syncdaemon/resource.py @@ -18,6 +18,7 @@ from gconf import gconf import repce from repce import RepceServer, RepceClient from master import GMaster +import syncdutils UrlRX = re.compile('\A(\w+)://(.*)') HostRX = re.compile('[a-z\d](?:[a-z\d.-]*[a-z\d])?', re.I) @@ -287,12 +288,15 @@ class AbstractUrl(object): def canonical_path(self): return self.path - def get_url(self, canonical=False): + def get_url(self, canonical=False, escaped=False): if canonical: pa = self.canonical_path() else: pa = self.path - return "://".join((self.scheme(), pa)) + u = "://".join((self.scheme(), pa)) + if escaped: + u = syncdutils.escape(u) + return u @property def url(self): |