summaryrefslogtreecommitdiffstats
path: root/xlators/features/glupy/examples/helloworld.py
diff options
context:
space:
mode:
authorJustin Clift <justin@gluster.org>2014-03-21 13:18:29 +0000
committerVijay Bellur <vbellur@redhat.com>2014-03-24 10:31:55 -0700
commit446547559952e3b8af943f87c7475b80dd090153 (patch)
treeb9a7541a39fae83df919bcebd954611fd5d66649 /xlators/features/glupy/examples/helloworld.py
parent853a90f9d7399e4afdb685946a809e9dd30a1b98 (diff)
features/glupy: Rename Glupy python module to avoid namespace conflictrelease-3.5
* Rename gluster.py to glupy.py to avoid namespace conflict (#1018619) * Move the main Glupy files into glusterfs-extra-xlators rpm * Move the Glupy Translator examples into glusterfs-devel rpm Backport of: http://review.gluster.org/#/c/6979/ Change-Id: Ie9b71b56502f8e98c527ade381c918446bc7f022 BUG: 1018619 Signed-off-by: Justin Clift <justin@gluster.org> Reviewed-on: http://review.gluster.org/7316 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Diffstat (limited to 'xlators/features/glupy/examples/helloworld.py')
-rw-r--r--xlators/features/glupy/examples/helloworld.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/xlators/features/glupy/examples/helloworld.py b/xlators/features/glupy/examples/helloworld.py
new file mode 100644
index 000000000..b565a4e5b
--- /dev/null
+++ b/xlators/features/glupy/examples/helloworld.py
@@ -0,0 +1,19 @@
+import sys
+from gluster.glupy import *
+
+class xlator (Translator):
+
+ def __init__(self, c_this):
+ Translator.__init__(self, c_this)
+
+ def lookup_fop(self, frame, this, loc, xdata):
+ print "Python xlator: Hello!"
+ dl.wind_lookup(frame, POINTER(xlator_t)(), loc, xdata)
+ return 0
+
+ def lookup_cbk(self, frame, cookie, this, op_ret, op_errno, inode, buf,
+ xdata, postparent):
+ print "Python xlator: Hello again!"
+ dl.unwind_lookup(frame, cookie, this, op_ret, op_errno, inode, buf,
+ xdata, postparent)
+ return 0