summaryrefslogtreecommitdiffstats
path: root/geo-replication/syncdaemon/libgfchangelog.py
diff options
context:
space:
mode:
authorSunny Kumar <sunkumar@redhat.com>2019-04-12 19:55:10 +0530
committerAmar Tumballi <amarts@redhat.com>2019-04-15 14:27:59 +0000
commitf316c8b797283818bd800569771870a4b9bf1310 (patch)
tree7e7c6fb89e35c167d9a4f2460620df52d7e46eab /geo-replication/syncdaemon/libgfchangelog.py
parentc27eee869f319fa2afbce31f1ab332d381015256 (diff)
libgfchangelog : use find_library to locate shared library
Issue: libgfchangelog.so: cannot open shared object file Due to hardcoded shared library name runtime loader looks for particular version of a shared library. Solution: Using find_library to locate shared library at runtime solves this issue. Traceback (most recent call last): File "/usr/libexec/glusterfs/python/syncdaemon/gsyncd.py", line 323, in main func(args) File "/usr/libexec/glusterfs/python/syncdaemon/subcmds.py", line 82, in subcmd_worker local.service_loop(remote) File "/usr/libexec/glusterfs/python/syncdaemon/resource.py", line 1261, in service_loop changelog_agent.init() File "/usr/libexec/glusterfs/python/syncdaemon/repce.py", line 233, in __call__ return self.ins(self.meth, *a) File "/usr/libexec/glusterfs/python/syncdaemon/repce.py", line 215, in __call__ raise res OSError: libgfchangelog.so: cannot open shared object file: No such file or directory Change-Id: I3dd013d701ed1cd99ba7ef20d1898f343e1db8f5 fixes: bz#1699394 Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
Diffstat (limited to 'geo-replication/syncdaemon/libgfchangelog.py')
-rw-r--r--geo-replication/syncdaemon/libgfchangelog.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/geo-replication/syncdaemon/libgfchangelog.py b/geo-replication/syncdaemon/libgfchangelog.py
index fff9d24e54f..8d129567075 100644
--- a/geo-replication/syncdaemon/libgfchangelog.py
+++ b/geo-replication/syncdaemon/libgfchangelog.py
@@ -10,13 +10,14 @@
import os
from ctypes import CDLL, RTLD_GLOBAL, get_errno, byref, c_ulong
+from ctypes.util import find_library
from syncdutils import ChangelogException, ChangelogHistoryNotAvailable
from py2py3 import gr_cl_history_changelog, gr_cl_done, gr_create_string_buffer
from py2py3 import gr_cl_register, gr_cl_history_done, bytearray_to_str
class Changes(object):
- libgfc = CDLL("libgfchangelog.so", mode=RTLD_GLOBAL,
+ libgfc = CDLL(find_library("gfchangelog"), mode=RTLD_GLOBAL,
use_errno=True)
@classmethod