I moved the method down since I find it easier to locate there. That was the primary reason. Thanks for pointing out the two linespace convention for python. Didn't know that. I will reintroduce them.
Matthias --- Jelmer Vernooij <[email protected]> schrieb am Sa, 28.11.2009: Von: Jelmer Vernooij <[email protected]> Betreff: Re: [SCM] Samba Shared Repository - branch master updated An: [email protected] CC: [email protected] Datum: Samstag, 28. November 2009, 15:16 Hi Matthias, On Fri, 2009-11-27 at 08:59 -0600, Matthias Dieter Wallnöfer wrote: > The branch, master has been updated > via 0cc45b4... s4:upgrade.py - rework to make the upgrade s3 -> s4 >possible again > via bd6c133... s4:upgrade_from_s3 - Fix message outputs > via dbb8989... s4:upgrade.py - the import of WINS databases don't >seem to work always > via 70b3161... s4:samba3.py - ignore comments in "smb.conf" files > via 82adfa3... s4:samba3.py - don't read those informations out from >the TDB > via f299efa... s4:samba3.py - support the TDB version 3 > from a5d854a... s4:provision - Fix up the provision of "standalone" >and "member" mode > > http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master > > > - Log ----------------------------------------------------------------- > commit 0cc45b47dc787abb2c3c31e4fc824798d9f3efe9 > Author: Matthias Dieter Wallnöfer <[email protected]> > Date: Fri Nov 27 15:50:26 2009 +0100 > > s4:upgrade.py - rework to make the upgrade s3 -> s4 possible again > > Able to read basic settings "workgroup", "realm", "netbios name" and the > function mode from the s3 "smb.conf" and use them for the provision of s4. > > commit bd6c133e506fdb5dee13e0a144ef99c6d452be42 > Author: Matthias Dieter Wallnöfer <[email protected]> > Date: Fri Nov 27 15:49:18 2009 +0100 > > s4:upgrade_from_s3 - Fix message outputs > > The quiet parameter was interpreted in the reverse manner. > > commit dbb8989e05ac3189a5eca11fa40d572388ea02fc > Author: Matthias Dieter Wallnöfer <[email protected]> > Date: Fri Nov 27 15:02:18 2009 +0100 > > s4:upgrade.py - the import of WINS databases don't seem to work always > > Disable it for now until the cause has been found > > commit 70b31610909544c58fd87c5e0aa00e02eb5f6d4b > Author: Matthias Dieter Wallnöfer <[email protected]> > Date: Fri Nov 27 15:00:41 2009 +0100 > > s4:samba3.py - ignore comments in "smb.conf" files > > commit 82adfa39b75aa628c88f828278c6ac09335d1a49 > Author: Matthias Dieter Wallnöfer <[email protected]> > Date: Fri Nov 27 14:59:12 2009 +0100 > > s4:samba3.py - don't read those informations out from the TDB > > At the moment those three calls are broken > > commit f299efa8f05c6a5b739222bdf75690a4591d3650 > Author: Matthias Dieter Wallnöfer <[email protected]> > Date: Fri Nov 27 14:58:37 2009 +0100 > > s4:samba3.py - support the TDB version 3 > > ----------------------------------------------------------------------- > > Summary of changes: > source4/scripting/bin/upgrade_from_s3 | 6 +- > source4/scripting/python/samba/samba3.py | 11 +- > source4/scripting/python/samba/upgrade.py | 144 ++++++++++++++-------------- > 3 files changed, 81 insertions(+), 80 deletions(-) > > > Changeset truncated at 500 lines: > > diff --git a/source4/scripting/bin/upgrade_from_s3 > b/source4/scripting/bin/upgrade_from_s3 > index 03f4415..7e1e1fd 100755 > --- a/source4/scripting/bin/upgrade_from_s3 > +++ b/source4/scripting/bin/upgrade_from_s3 > @@ -50,14 +50,14 @@ opts, args = parser.parse_args() > > def message(text): > """Print a message if quiet is not set.""" > - if opts.quiet: > + if not opts.quiet: > print text > > if len(args) < 1: > parser.print_usage() > sys.exit(1) > > -message("Reading Samba3 databases and smb.conf\n") > +message("Reading Samba3 databases and smb.conf") > > libdir = args[0] > if not os.path.isdir(libdir): > @@ -71,7 +71,7 @@ else: > > samba3 = Samba3(libdir, smbconf) > > -message("Provisioning\n") > +message("Provisioning") > > setup_dir = opts.setupdir > if setup_dir is None: > diff --git a/source4/scripting/python/samba/samba3.py > b/source4/scripting/python/samba/samba3.py > index 179efa2..c21b457 100644 > --- a/source4/scripting/python/samba/samba3.py > +++ b/source4/scripting/python/samba/samba3.py > @@ -509,7 +509,7 @@ class TdbSam(TdbDatabase): > """Samba 3 TDB passdb backend reader.""" > def _check_version(self): > self.version = fetch_uint32(self.tdb, "INFO/version\0") or 0 > - assert self.version in (0, 1, 2) > + assert self.version in (0, 1, 2, 3) ^^ Please revert these changes. Clearly we don't support version 3 yet, so we shouldn't pretend like we do. I'd rather see us fail with a clear assertion error than breaking the v2 support. Furthermore, supporting version 3 properly shouldn't be too hard. > def usernames(self): > """Iterate over the usernames in this Tdb database.""" > @@ -592,9 +592,10 @@ class TdbSam(TdbDatabase): > for entry in hours: > for i in range(8): > user.hours.append(ord(entry) & (2 ** i) == (2 ** i)) > - (user.bad_password_count, data) = unpack_uint16(data) > - (user.logon_count, data) = unpack_uint16(data) > - (user.unknown_6, data) = unpack_uint32(data) > + # FIXME > + #(user.bad_password_count, data) = unpack_uint16(data) > + #(user.logon_count, data) = unpack_uint16(data) > + #(user.unknown_6, data) = unpack_uint32(data) > assert len(data) == 0 > return user > > @@ -683,7 +684,7 @@ class ParamFile(object): > section = None > for i, l in enumerate(open(filename, 'r').xreadlines()): > l = l.strip() > - if not l: > + if not l or l[0] == '#' or l[0] == ';': > continue > if l[0] == "[" and l[-1] == "]": > section = self._sanitize_name(l[1:-1]) > diff --git a/source4/scripting/python/samba/upgrade.py > b/source4/scripting/python/samba/upgrade.py > index 8194552..44b43a1 100644 > --- a/source4/scripting/python/samba/upgrade.py > +++ b/source4/scripting/python/samba/upgrade.py > @@ -92,7 +93,6 @@ def import_sam_account(samldb,acc,domaindn,domainsid): > "ntPwdHash:": acc.nt_password, > }) > > - > def import_sam_group(samldb, sid, gid, sid_name_use, nt_name, comment, >domaindn): > """Upgrade a SAM group. > > @@ -132,7 +132,6 @@ def import_sam_group(samldb, sid, gid, sid_name_use, > nt_name, comment, domaindn) > "samba3SidNameUse": str(sid_name_use) > }) > > - ^^ The two empty lines are intentional here - PEP8 (standard coding style for Python) specifies two empty lines between top-level objects. Please don't remove them. > @@ -157,7 +156,6 @@ def import_idmap(samdb,samba3_idmap,domaindn): > "type": "group", > "unixID": str(gid)}) > > - > def import_wins(samba4_winsdb, samba3_winsdb): > """Import settings from a Samba3 WINS database. > > @@ -208,73 +206,6 @@ def import_wins(samba4_winsdb, samba3_winsdb): > "objectClass": "winsMaxVersion", > "maxVersion": str(version_id)}) > > -def upgrade_provision(samba3, setup_dir, message, credentials, session_info, > smbconf, targetdir): ^^^ Why did you move this function? It makes it very hard to spot what actual changes you made. Cheers, Jelmer __________________________________________________ Do You Yahoo!? Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen Massenmails. http://mail.yahoo.com
