summaryrefslogtreecommitdiffstats
path: root/xlators/features
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/features')
-rw-r--r--xlators/features/glupy/Makefile.am2
-rw-r--r--xlators/features/glupy/examples/Makefile.am5
-rw-r--r--xlators/features/glupy/examples/debug-trace.py (renamed from xlators/features/glupy/src/debug-trace.py)11
-rw-r--r--xlators/features/glupy/examples/helloworld.py (renamed from xlators/features/glupy/src/helloworld.py)2
-rw-r--r--xlators/features/glupy/examples/negative.py (renamed from xlators/features/glupy/src/negative.py)3
-rw-r--r--xlators/features/glupy/src/Makefile.am13
-rw-r--r--xlators/features/glupy/src/glupy.c5
-rw-r--r--xlators/features/glupy/src/glupy.py (renamed from xlators/features/glupy/src/gluster.py)0
-rw-r--r--xlators/features/glupy/src/setup.py.in24
9 files changed, 48 insertions, 17 deletions
diff --git a/xlators/features/glupy/Makefile.am b/xlators/features/glupy/Makefile.am
index a985f42a877..060429ecf0f 100644
--- a/xlators/features/glupy/Makefile.am
+++ b/xlators/features/glupy/Makefile.am
@@ -1,3 +1,3 @@
-SUBDIRS = src
+SUBDIRS = src examples
CLEANFILES =
diff --git a/xlators/features/glupy/examples/Makefile.am b/xlators/features/glupy/examples/Makefile.am
new file mode 100644
index 00000000000..c26abeaafb6
--- /dev/null
+++ b/xlators/features/glupy/examples/Makefile.am
@@ -0,0 +1,5 @@
+xlatordir = $(libdir)/glusterfs/$(PACKAGE_VERSION)/xlator/features
+
+glupyexamplesdir = $(xlatordir)/glupy
+
+glupyexamples_PYTHON = negative.py helloworld.py debug-trace.py
diff --git a/xlators/features/glupy/src/debug-trace.py b/xlators/features/glupy/examples/debug-trace.py
index 53e76546b15..6eef1b58b8f 100644
--- a/xlators/features/glupy/src/debug-trace.py
+++ b/xlators/features/glupy/examples/debug-trace.py
@@ -2,12 +2,13 @@ import sys
import stat
from uuid import UUID
from time import strftime, localtime
-from gluster import *
+from gluster.glupy import *
+
# This translator was written primarily to test the fop entry point definitions
-# and structure definitions in 'gluster.py'.
-# It is similar to the debug-trace translator, one of the already available
-# translator types written in C, that logs the arguments passed to the fops and
-# their corresponding cbk functions.
+# and structure definitions in 'glupy.py'.
+
+# It is similar to the C language debug-trace translator, which logs the
+# arguments passed to the fops and their corresponding cbk functions.
dl.get_id.restype = c_long
dl.get_id.argtypes = [ POINTER(call_frame_t) ]
diff --git a/xlators/features/glupy/src/helloworld.py b/xlators/features/glupy/examples/helloworld.py
index 8fe4037118e..b565a4e5bc3 100644
--- a/xlators/features/glupy/src/helloworld.py
+++ b/xlators/features/glupy/examples/helloworld.py
@@ -1,5 +1,5 @@
import sys
-from gluster import *
+from gluster.glupy import *
class xlator (Translator):
diff --git a/xlators/features/glupy/src/negative.py b/xlators/features/glupy/examples/negative.py
index 1023602b9f3..e7a4fc07ced 100644
--- a/xlators/features/glupy/src/negative.py
+++ b/xlators/features/glupy/examples/negative.py
@@ -1,6 +1,6 @@
import sys
from uuid import UUID
-from gluster import *
+from gluster.glupy import *
# Negative-lookup-caching example. If a file wasn't there the last time we
# looked, it's probably still not there. This translator keeps track of
@@ -89,4 +89,3 @@ class xlator (Translator):
dl.unwind_create(frame,cookie,this,op_ret,op_errno,fd,inode,buf,
preparent,postparent,xdata)
return 0
-
diff --git a/xlators/features/glupy/src/Makefile.am b/xlators/features/glupy/src/Makefile.am
index 9608628398f..9ba33a1f2c6 100644
--- a/xlators/features/glupy/src/Makefile.am
+++ b/xlators/features/glupy/src/Makefile.am
@@ -1,11 +1,12 @@
xlator_LTLIBRARIES = glupy.la
+# Ensure GLUSTER_PYTHON_PATH is passed to glupy.so
xlatordir = $(libdir)/glusterfs/$(PACKAGE_VERSION)/xlator/features
-
glupydir = $(xlatordir)/glupy
+AM_CPPFLAGS = $(GF_CPPFLAGS) -I$(top_srcdir)/libglusterfs/src -isystem $(BUILD_PYTHON_INC)
+AM_CFLAGS = -Wall -fno-strict-aliasing -DGLUSTER_PYTHON_PATH=\"$(glupydir)\" $(GF_CFLAGS)
-glupy_PYTHON = gluster.py negative.py helloworld.py debug-trace.py
-
+# Flags to build glupy.so with
glupy_la_LDFLAGS = -module -avoid-version -shared -nostartfiles
glupy_la_SOURCES = glupy.c
glupy_la_LIBADD = $(top_builddir)/libglusterfs/src/libglusterfs.la \
@@ -13,8 +14,8 @@ glupy_la_LIBADD = $(top_builddir)/libglusterfs/src/libglusterfs.la \
noinst_HEADERS = glupy.h
-AM_CPPFLAGS = $(GF_CPPFLAGS) -I$(top_srcdir)/libglusterfs/src -isystem $(BUILD_PYTHON_INC)
-
-AM_CFLAGS = -Wall -fno-strict-aliasing -DGLUSTER_PYTHON_PATH=\"$(glupydir)\" $(GF_CFLAGS)
+# Install glupy.py into the Python site-packages area
+pyglupydir = $(pythondir)/gluster
+pyglupy_PYTHON = glupy.py
CLEANFILES =
diff --git a/xlators/features/glupy/src/glupy.c b/xlators/features/glupy/src/glupy.c
index dc86c0071e1..948b66f8d11 100644
--- a/xlators/features/glupy/src/glupy.c
+++ b/xlators/features/glupy/src/glupy.c
@@ -2365,7 +2365,7 @@ init (xlator_t *this)
goto *err_cleanup;
}
- gf_log (this->name, GF_LOG_ERROR, "py_mod_name = %s", module_name);
+ gf_log (this->name, GF_LOG_DEBUG, "py_mod_name = %s", module_name);
priv->py_module = PyImport_Import(py_mod_name);
Py_DECREF(py_mod_name);
if (!priv->py_module) {
@@ -2375,6 +2375,7 @@ init (xlator_t *this)
}
goto *err_cleanup;
}
+ gf_log (this->name, GF_LOG_INFO, "Import of %s succeeded", module_name);
err_cleanup = &&err_deref_module;
py_init_func = PyObject_GetAttrString(priv->py_module, "xlator");
@@ -2407,7 +2408,7 @@ init (xlator_t *this)
}
goto *err_cleanup;
}
- gf_log (this->name, GF_LOG_INFO, "init returned %p", priv->py_xlator);
+ gf_log (this->name, GF_LOG_DEBUG, "init returned %p", priv->py_xlator);
return 0;
diff --git a/xlators/features/glupy/src/gluster.py b/xlators/features/glupy/src/glupy.py
index a5daa77d32a..a5daa77d32a 100644
--- a/xlators/features/glupy/src/gluster.py
+++ b/xlators/features/glupy/src/glupy.py
diff --git a/xlators/features/glupy/src/setup.py.in b/xlators/features/glupy/src/setup.py.in
new file mode 100644
index 00000000000..1aea9875f0a
--- /dev/null
+++ b/xlators/features/glupy/src/setup.py.in
@@ -0,0 +1,24 @@
+from distutils.core import setup
+
+DESC = """GlusterFS is a clustered file-system capable of scaling to
+several petabytes. It aggregates various storage bricks over Infiniband
+RDMA or TCP/IP interconnect into one large parallel network file system.
+GlusterFS is one of the most sophisticated file systems in terms of
+features and extensibility. It borrows a powerful concept called
+Translators from GNU Hurd kernel. Much of the code in GlusterFS is in
+user space and easily manageable.
+
+This package contains Glupy, the Python translator interface for GlusterFS."""
+
+setup(
+ name='glusterfs-glupy',
+ version='@PACKAGE_VERSION@',
+ description='Glupy is the Python translator interface for GlusterFS',
+ long_description=DESC,
+ author='Gluster Community',
+ author_email='gluster-devel@nongnu.org',
+ license='LGPLv3',
+ url='http://gluster.org/',
+ package_dir={'gluster':''},
+ packages=['gluster']
+)