summaryrefslogtreecommitdiffstats
path: root/xlators/features/changelog/lib/examples/python/libgfchangelog.py
diff options
context:
space:
mode:
authorKotresh HR <khiremat@redhat.com>2015-07-01 12:06:42 +0530
committerVenky Shankar <vshankar@redhat.com>2015-07-02 06:16:34 -0700
commit2f5355f76a8168bc504cba8237f0825fc181fce8 (patch)
treedc4ec955962624138102e9a2a41ec7cdd1074963 /xlators/features/changelog/lib/examples/python/libgfchangelog.py
parent8def0f28c908224359a04ec2f658a3ba241c7249 (diff)
libgfchangelog: Fix example programs
Incorporate the new API 'gf_changelog_init' introduced in libgfchangelog which should be called before 'gf_changelog_register'. Change-Id: I10a9dd5ff3ecc64fd61dcb6b1aa53739e0bdeedd BUG: 1238063 Signed-off-by: Kotresh HR <khiremat@redhat.com> Reviewed-on: http://review.gluster.org/11479 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Venky Shankar <vshankar@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'xlators/features/changelog/lib/examples/python/libgfchangelog.py')
-rw-r--r--xlators/features/changelog/lib/examples/python/libgfchangelog.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/xlators/features/changelog/lib/examples/python/libgfchangelog.py b/xlators/features/changelog/lib/examples/python/libgfchangelog.py
index 68ec3baf144..10e73c02b34 100644
--- a/xlators/features/changelog/lib/examples/python/libgfchangelog.py
+++ b/xlators/features/changelog/lib/examples/python/libgfchangelog.py
@@ -3,7 +3,7 @@ from ctypes import *
from ctypes.util import find_library
class Changes(object):
- libgfc = CDLL(find_library("gfchangelog"), use_errno=True)
+ libgfc = CDLL(find_library("gfchangelog"), mode=RTLD_GLOBAL, use_errno=True)
@classmethod
def geterrno(cls):
@@ -19,6 +19,12 @@ class Changes(object):
return getattr(cls.libgfc, call)
@classmethod
+ def cl_init(cls):
+ ret = cls._get_api('gf_changelog_init')(None)
+ if ret == -1:
+ cls.raise_changelog_err()
+
+ @classmethod
def cl_register(cls, brick, path, log_file, log_level, retries = 0):
ret = cls._get_api('gf_changelog_register')(brick, path,
log_file, log_level, retries)