--kerberos option
Giampaolo Lauria
lauria at us.ibm.com
Tue Oct 11 15:50:14 MDT 2011
Hi Andrew,
I was wondering whether I could change the --kerberos credential option to
be a boolean. Currently, it takes an argument which value could be in
(yes,true,1,no, false,0). Also, what should the value of the kerberos
state if the option is not specified?
Following is the code that handles the option:
def _set_kerberos(self, option, opt_str, arg, parser):
if arg.lower() in ["yes", 'true', '1']:
self.creds.set_kerberos_state(MUST_USE_KERBEROS)
elif arg.lower() in ["no", 'false', '0']:
self.creds.set_kerberos_state(DONT_USE_KERBEROS)
else:
raise optparse.BadOptionErr("invalid kerberos option: %s" %
arg)
the option help says: "use kerberos", so why should the user specify a
value?
Also, optparse.BadOptionErr does not exist and specifying a value for this
option other than the ones above causes an ugly error.
Thanks,
Giampaolo
More information about the samba-technical
mailing list