diff options
author | Csaba Henk <csaba@gluster.com> | 2011-02-15 18:01:54 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2011-02-15 21:44:56 -0800 |
commit | 43b68bb25c9ee16c10342ef643a6ecb82a345e16 (patch) | |
tree | 9ef054106f742d52052da6a9fc621cfd10fd1ee5 /xlators/features/marker | |
parent | 8ce08eb78165c9107925f23ac3057ee2cc01ff2f (diff) |
syncdaemon: fix RePCe version query
RepceClient.repce_version fetched its own RePCe version, instead of
querying peer, so lame.
Signed-off-by: Csaba Henk <csaba@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 2381 (RePCe versioning)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2381
Diffstat (limited to 'xlators/features/marker')
-rw-r--r-- | xlators/features/marker/utils/syncdaemon/repce.py | 17 | ||||
-rw-r--r-- | xlators/features/marker/utils/syncdaemon/resource.py | 2 |
2 files changed, 11 insertions, 8 deletions
diff --git a/xlators/features/marker/utils/syncdaemon/repce.py b/xlators/features/marker/utils/syncdaemon/repce.py index aebc8b7d8..1b8d0203c 100644 --- a/xlators/features/marker/utils/syncdaemon/repce.py +++ b/xlators/features/marker/utils/syncdaemon/repce.py @@ -65,12 +65,15 @@ class RepceServer(object): rid = in_data[0] rmeth = in_data[1] exc = False - try: - res = getattr(self.obj, rmeth)(*in_data[2:]) - except: - res = sys.exc_info()[1] - exc = True - logging.exception("call failed: ") + if rmeth == '__repce_version__': + res = repce_version + else: + try: + res = getattr(self.obj, rmeth)(*in_data[2:]) + except: + res = sys.exc_info()[1] + exc = True + logging.exception("call failed: ") send(self.out, rid, exc, res) @@ -151,7 +154,7 @@ class RepceClient(object): return self.mprx(self, meth) def __version__(self): - d = {'proto': repce_version} + d = {'proto': self('__repce_version__')} try: d['object'] = self('version') except AttributeError: diff --git a/xlators/features/marker/utils/syncdaemon/resource.py b/xlators/features/marker/utils/syncdaemon/resource.py index 6697ab8c4..efd136075 100644 --- a/xlators/features/marker/utils/syncdaemon/resource.py +++ b/xlators/features/marker/utils/syncdaemon/resource.py @@ -428,7 +428,7 @@ class SSH(AbstractUrl, SlaveRemote): # in daemon), we just do a an ad-hoc linear put/get. i, o = ret inf = os.fdopen(i) - repce.send(o, None, 'ping') + repce.send(o, None, '__repce_version__') select.select((inf,), (), ()) repce.recv(inf) # hack hack hack: store a global reference to the file |