[SCM] Samba Shared Repository - branch master updated

Jelmer Vernooij jelmer at samba.org
Sat Nov 28 07:10:26 MST 2009


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 <mwallnoefer at yahoo.de>
> Date:   Fri Nov 27 13:07:52 2009 +0100
> 
>     s4:provision.py - cosmetic output correction
> 
> commit 6b835b0691faab904246e587ffa6ff74b9fb53e2
> Author: Matthias Dieter Wallnöfer <mwallnoefer at 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: This is a digitally signed message part
URL: <http://lists.samba.org/pipermail/samba-cvs/attachments/20091128/36046a4f/attachment-0001.pgp>


More information about the samba-cvs mailing list