[PATCH] Python3 compatible modules - credentials, param, _glue
Andrew Bartlett
abartlet at samba.org
Mon Jan 30 19:24:13 UTC 2017
On Mon, 2017-01-30 at 16:59 +0100, Lumir Balhar wrote:
> On 01/27/2017 07:17 AM, Andrew Bartlett wrote:
> > On Sat, 2017-01-14 at 07:05 +1300, Andrew Bartlett wrote:
> > > On Fri, 2017-01-13 at 12:01 +0100, Lumir Balhar wrote:
> > > > > On 01/05/2017 07:10 PM, Andrew Bartlett wrote:
> > > > > > On Thu, 2017-01-05 at 14:01 +0100, Lumir Balhar wrote:
> > > > > > > On 12/22/2016 07:00 PM, Andrew Bartlett wrote:
> > > >
> > > > [...]
> > > > > > > Perhaps skip the raw DCE/RPC tests, add some expected
> > > > > > > value
> > > > > > > testing
> > > > > > > to
> > > > > > > samba/tests/auth.py and run samba/tests/gensec.py?
> > > > > >
> > > > > > Ok, I can skip tests of DCE/RPC and run tests of gensec
> > > > > > but
> > > > > > first I
> > > > > > need
> > > > > > to port samba.gensec module and samba.tests.gensec. It
> > > > > > looks
> > > > > > like
> > > > > > that
> > > > > > it will be simple without another dependency chain.
> > > > >
> > > > > Good!
> > > >
> > > >
> > > > It seems that my expectations were wrong. I found out that
> > > > tests of
> > > > the
> > > > gensec module are planned old way with planoldpythontestsuite()
> > > > function
> > > > which is not prepared for Python 3 yet.
> > > > Of course, I can port this functionality as well but I've
> > > > discovered
> > > > another long dependency chain which goes through modules
> > > > getopt,
> > > > hostconfig, dsdb, dsdb_dns and maybe more - so it will take
> > > > some
> > > > time
> > > > to
> > > > do it and it will add other changes to patchset.
> > > >
> > > > This is just a heads-up that the patchset will be even larger
> > > > than
> > > > expected, unless you see a different way forward.
> > >
> > > I do.
> > >
> > > You should be able to prove to yourself that HostConfig is
> > > unused,
> > > except for tests, but the easiest course of action is to remove
> > > get_hostconfig() from the getopt.py script, as that is both
> > > unused
> > > and
> > > untested.
> > >
> > > The HostConfig abstraction never really took off, despite looking
> > > like
> > > a reasonable idea, so you can also remove the get_samdb() call
> > > from
> > > it
> > > as well if that is helpful somehow.
> > >
> > > That should cut down the dep chain for now. When we get back to
> > > it,
> > > it
> > > looks like there is some other code here we should remove or
> > > finally
> > > use.
> >
> > Do you have an updated patch set? I'm hoping we can land this
> > without
> > a disastrous conflict with the --disable-python patch set, and it
> > would
> > be helpful to see the current state of play.
> >
> > Thanks,
> >
> > Andrew Bartlett
> >
>
> Hello.
>
> Sorry for later reply but I was on DevConf in Brno and I was a bit
> sick
> before it.
>
> Here is updated patchset. It contains a lot of changes discussed
> before,
> fixes, new tests and more.
>
> Commit fc31cd9 (patch 12) adds one static function to the header
> file
> py3compat.h, which is not the best but I cannot find a better
> solution
> here because I need to redefine two function calls and I can't do it
> just with macro. Another possible solution for this problem is to
> use
> #if/#else/#endif everywhere is PyCObject_FromVoidPtrAndDesc used
> (including in the PIDL generator).
>
> I hope that everything will be good for you.
This is really good. There is a stray PY3 import into
samba/__init__.py
The thing that scared me more was the regular expression for expanding
the code to call PyCObject_FromVoidPtrAndDesc in pidl :-)
I can see why it was done however, and I don't really mine.
I would really appreciate a second or more set of eyes over this, and
I'll get you a formal review shortly after more examination, but I'm
reasonably comfortable with how this is landing!
Thanks!
Andrew Bartlett
--
Andrew Bartlett http://samba.org/~abartlet/
Authentication Developer, Samba Team http://samba.org
Samba Developer, Catalyst IT http://catalyst.net.nz/services/samba
More information about the samba-technical
mailing list