[Samba4] 'default_ldb_modules_dir' is not defined [WAS]: removed smbpython

Manu manu.b2007 at gmail.com
Wed May 21 22:00:03 GMT 2008


In fact I have now this error :

root at chaos:/usr/local/samba/share/setup# ./newuser --unixname=user3 user3
pass
New event context requested. Parent: [struct cli_credentials:0x81cfd90]
Traceback (most recent call last):
  File "./newuser", line 56, in <module>
    credentials=creds, lp=lp)
  File "/usr/local/samba/lib/python2.5/site-packages/samba/samdb.py", line
42, in __init__
    modules_dir=modules_dir, lp=lp)
  File "/usr/local/samba/lib/python2.5/site-packages/samba/__init__.py",
line 68, in __init__
    elif default_ldb_modules_dir is not None:
NameError: global name 'default_ldb_modules_dir' is not defined

---
In __init__.py :
        if modules_dir is not None:
            self.set_modules_dir(modules_dir)
        elif default_ldb_modules_dir is not None:
            self.set_modules_dir(default_ldb_modules_dir)

"modules_dir" seems to be void and "default_ldb_modules_dir" is not
defined, it is defined when ran from sources.

Manu.


> -----Message d'origine-----
> De : Manu [mailto:manu.b2007 at gmail.com]
> Envoyé : mercredi 21 mai 2008 20:21
> À : 'Jelmer Vernooij'; 'samba-technical at samba.org'
> Objet : RE: [SAMBA4] removed smbpython
> 
> 
> I had a typo error in PYTHONPATH variable :(
> Sorry for my post, it works as expected now :)
> 
> Manu.
> 
> > -----Message d'origine-----
> > De : Manu [mailto:manu.b2007 at gmail.com]
> > Envoyé : mercredi 21 mai 2008 18:50
> > À : 'Jelmer Vernooij'; 'samba-technical at samba.org'
> > Objet : RE: [SAMBA4] removed smbpython
> >
> >
> > Hi,
> >
> > I have a dummy question :)
> >
> > If I try to run a python script from samba source tree, it works
> > fine, but not from install directory :
> >
> > root at chaos:/shared/src/samba4/source# ./setup/newuser --help
> > Usage: newuser [options] <username> [<password>]
> >
> > root at chaos:/usr/local/samba/share# ./setup/newuser --help
> > Traceback (most recent call last):
> >   File "./setup/newuser", line 14, in <module>
> >     import samba.getopt as options
> > ImportError: No module named samba.getopt
> >
> > I pulled sources from git today.
> >
> > Thanks,
> >
> > Manu.
> >
> > > -----Message d'origine-----
> > > De : samba-technical-bounces+manu.b2007=gmail.com at lists.samba.org
> > > [mailto:samba-technical-bounces+manu.b2007=gmail.com at lists.samba.org]
> De
> > > la part de Jelmer Vernooij
> > > Envoyé : mercredi 21 mai 2008 14:38
> > > À : samba-technical at samba.org
> > > Objet : [SAMBA4] removed smbpython
> > >
> > > -----BEGIN PGP SIGNED MESSAGE-----
> > > Hash: SHA1
> > >
> > > Samba 4 now no longer has a 'smbpython' binary. Instead, you should be
> > > able to use the system-provided Python interpreter with the Samba
> > > modules.
> > >
> > > To make Python find these modules for your own scripts, it may be
> > > necessary to adjust the Python library path. This can be done from
> > > within your python script:
> > >
> > > import sys
> > > sys.append.insert(0, "bin/python")
> > >
> > > or using an environment variable:
> > >
> > > PYTHONPATH=/usr/local/samba/lib/python2.5/site-packages
> > >
> > > I've already made those changes for the scripts inside Samba 4.
> > >
> > > Cheers,
> > >
> > > Jelmer
> > > -----BEGIN PGP SIGNATURE-----
> > > Version: GnuPG v1.4.6 (GNU/Linux)
> > > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
> > >
> > > iQCVAwUBSDQXjwy0JeEGD2blAQIECAP/Uv2ItGIHmjdvoZ87gTCheu85B0m2JIDD
> > > 5tSnwmWiBYhYA4W5X9IwmGp3lH+SmSyMX6R6ISC16D2wwV5zF3OAiB4Z6B7QtIBD
> > > Ch7eCW2yURhkBhgu6jJPZzDiyNyz11aFP0yLMfEJwTYb9oq53wakHVZssd01b6ki
> > > fbjz4bFwKrs=
> > > =MGej
> > > -----END PGP SIGNATURE-----



More information about the samba-technical mailing list