[Gluster-devel] Glupy bugs: found the solution?

Niels de Vos ndevos at redhat.com
Sat Oct 26 15:47:17 UTC 2013


On Sat, Oct 26, 2013 at 03:33:10PM +0100, Justin Clift wrote:
> On Sun, 20 Oct 2013 23:08:41 -0400 (EDT)
> Ramana Raja <rraja at redhat.com> wrote:
> 
> > Hi Justin,
> > 
> > Initially, I ran into the same problems as you did. The problem was that Glupy's translators (negative, debug) were not importing Glupy's gluster module, which is the actual python glue, but instead importing Gluster-swift's gluster module :(. So all I had to do was to rename Glupy's gluster module as glupy_gluster and the translators began to work.
> 
> Interestingly, I just got time to try this, and it did work:
> 
>   $ sudo gluster volume stop playground
>   $ sudo systemctl stop glusterd
>   $ sudo mv /usr/lib64/glusterfs/3git/xlator/features/glupy/gluster.py /usr/lib64/glusterfs/3git/xlator/features/glupy/gluster_glupy.py
>   $ sudo rm /usr/lib64/glusterfs/3git/xlator/features/glupy/gluster.py?
>   $ sudo systemctl start glusterd
>   $ sudo gluster volume start playground
> 
> Then changed helloworld.py from:
> 
>   from gluster import *
> 
> to:
> 
>   from gluster_glupy import *
> 
> and Voila, the correct output appears when starting a volume
> using the helloworld translator:
> 
>   Python xlator: Hello!
> 
> 
> > Can you please check if your Glupy translators are importing the Glupy's gluster module, and not something else?
> > I did this as follows: 
> > - Inserted pdb.set_trace() as the first line of negative.py
> > - While Pdb-ing, ran "print sys.modules['gluster']" after "from gluster import *" was executed
> 
> I haven't used Pdb before, instead I'm using PyCharm (an IDE).  I need
> to figure out how to get the debugger in that working with Glupy
> translators so I can find out what's being called from where.
> 
> Kind of suspecting it might be the libgfapi stuff (not Swift)
> getting picked up on my system instead of Glupy.  But really,

That is correct. Recent glusterfs-api RPMs provide 
/usr/lib/python2.6/site-packages/gluster/gfapi.py so that a future swift 
implementation can use that. It is also trivial to write your own Python 
script that imports gluster.gfapi and accesses volumes through libgfapi.  
See slide 10 from 
http://people.redhat.com/ndevos/talks/Gluster-Stockholm-20130902.pdf for 
a minimal example.

> I have no idea for sure and could easily be wrong.
> 
> 
> > I'll send a patch to Gluster upstream renaming Glupy's gluster 
> > module as gluster_glupy by citing module-name conflict issues.
> 
> I still feel this isn't the right approach.  Swift is just a component
> of an external project, whereas Glupy is a component of our own project.

After several discussions with different developers, it was decided that 
the Python package 'gluster' will be the base for other modules. Hence 
we have created put the api bindings in gluster/gfapi.py. I think it 
would make sense to rename the Glupy module gluster.glupy. If it can be 
placed in /usr/lib/python2.6/site-packages/gluster/glupy.py things would 
be even nicer :)

HTH,
Niels


> 
> So, if anything needs renaming it should be the Swift component not
> the Glupy one.
> 
> Does that make sense? :)
> 
> Regards and best wishes,
> 
> Justin Clift
> 
> 
> > Hope your Glupy works.
> > 
> > 
> > Thanks,
> > 
> > Ram 
> 
> 
> -- 
> Justin Clift <jclift at redhat.com>
> 
> _______________________________________________
> Gluster-devel mailing list
> Gluster-devel at nongnu.org
> https://lists.nongnu.org/mailman/listinfo/gluster-devel




More information about the Gluster-devel mailing list