Jelmer, sorry for the remove of the first code block "if not opts.interactive and (opts.realm is None or opts.domain is None):". I was too fast and thought maybe this was the problem since the interactive mode didn't work on my box. Later I discovered that this is due to the split function of the call socket.getfqdn().split(".", 1)[1].upper()). Therefore I would let in the error handling like this since it's really a bugfix.
Okay, the first part I will restore Matthias --- Jelmer Vernooij <jel...@samba.org> schrieb am Sa, 28.11.2009: Von: Jelmer Vernooij <jel...@samba.org> Betreff: Re: [SCM] Samba Shared Repository - branch master updated An: samba-techni...@lists.samba.org CC: samba-...@samba.org Datum: Samstag, 28. November 2009, 15:10 On Fri, 2009-11-27 at 06:04 -0600, Matthias Dieter Wallnöfer wrote: > The branch, master has been updated > via a7fa3a9... s4:provision.py - cosmetic output correction > via 6b835b0... s4:setup/provision - make the interactive mode work >again > from 7504b03... s4:WHATSNEW4.txt - Add also here a comment about the >"upgrade_from_s3" script > > http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master > > > - Log ----------------------------------------------------------------- > commit a7fa3a9703bf9f0c72031c84998f4fb21ba95429 > Author: Matthias Dieter Wallnöfer <mwallnoe...@yahoo.de> > Date: Fri Nov 27 13:07:52 2009 +0100 > > s4:provision.py - cosmetic output correction > > commit 6b835b0691faab904246e587ffa6ff74b9fb53e2 > Author: Matthias Dieter Wallnöfer <mwallnoe...@yahoo.de> > Date: Fri Nov 27 13:02:31 2009 +0100 > > s4:setup/provision - make the interactive mode work again > > ----------------------------------------------------------------------- > > Summary of changes: > source4/scripting/python/samba/provision.py | 2 +- > source4/setup/provision | 16 +++------------- > 2 files changed, 4 insertions(+), 14 deletions(-) > index ed350dd..f1aa07c 100755 > --- a/source4/setup/provision > +++ b/source4/setup/provision > @@ -122,14 +122,6 @@ def message(text): > if len(sys.argv) == 1: > opts.interactive = True > > -if not opts.interactive and (opts.realm is None or opts.domain is None): > - if opts.realm is None: > - print >>sys.stderr, "No realm set" > - if opts.domain is None: > - print >>sys.stderr, "No domain set" > - parser.print_usage() > - sys.exit(1) > - ^^^ This change isn't necessary to make the interactive mode work (it explicitly checks for interactive mode not being in use), and it breaks usage when not in interactive mode because we end up with no realm/domain being set. > if opts.interactive: > from getpass import getpass > import socket > @@ -137,19 +129,17 @@ if opts.interactive: > if default is not None: > print "%s [%s]: " % (prompt,default), > else: > - print "%s: " % (prompt,), > + print "%s: " % (prompt), > return sys.stdin.readline().rstrip("\n") or default > try: > opts.realm = ask("Realm", socket.getfqdn().split(".", 1)[1].upper()) > except IndexError: > - print >>sys.stderr, "Cannot guess realm from %s" % ( > socket.getfqdn()) > - sys.exit(1) > + opts.realm = ask("Realm", None) ^^^ We've already asked the user for a realm, why ask twice? Rather, we should not set a default value if the users FQDN is broken because it contains no dots. > try: > opts.domain = ask("Domain", opts.realm.split(".")[0]) > except IndexError: > - print >>sys.stderr, "Cannot guess domain from %s" % ( opts.realm()) > - sys.exit(1) > + opts.domain = ask("Domain", None) ^^^ Same here, let's just get the default value right in the first place. Cheers, Jelmer __________________________________________________ Do You Yahoo!? Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen Massenmails. http://mail.yahoo.com