diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2011-10-11 23:56:15 +0200 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2011-10-12 02:12:21 +0200 |
commit | eb971614e538a16852b3cbc3677fb06eb57e6a83 (patch) | |
tree | 5d9bed053bfaa778ec785109bd46ca0c7dccf776 /source4/scripting | |
parent | b0d76efb6e15c98b718a6412421c25c16837de37 (diff) | |
download | samba-eb971614e538a16852b3cbc3677fb06eb57e6a83.tar.gz samba-eb971614e538a16852b3cbc3677fb06eb57e6a83.tar.bz2 samba-eb971614e538a16852b3cbc3677fb06eb57e6a83.zip |
samba.getopt: Allow --kerberos=auto, and fix exception name if an unknown
value is specified.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Wed Oct 12 02:12:21 CEST 2011 on sn-devel-104
Diffstat (limited to 'source4/scripting')
-rw-r--r-- | source4/scripting/python/samba/getopt.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source4/scripting/python/samba/getopt.py b/source4/scripting/python/samba/getopt.py index 01e9f87e76..1b30d2fade 100644 --- a/source4/scripting/python/samba/getopt.py +++ b/source4/scripting/python/samba/getopt.py @@ -25,6 +25,7 @@ import optparse import os from samba.credentials import ( Credentials, + AUTO_USE_KERBEROS, DONT_USE_KERBEROS, MUST_USE_KERBEROS, ) @@ -150,8 +151,10 @@ class CredentialsOptions(optparse.OptionGroup): self.creds.set_kerberos_state(MUST_USE_KERBEROS) elif arg.lower() in ["no", 'false', '0']: self.creds.set_kerberos_state(DONT_USE_KERBEROS) + elif arg.lower() in ["auto"]: + self.creds.set_kerberos_state(AUTO_USE_KERBEROS) else: - raise optparse.BadOptionErr("invalid kerberos option: %s" % arg) + raise optparse.BadOptionError("invalid kerberos option: %s" % arg) def _set_simple_bind_dn(self, option, opt_str, arg, parser): self.creds.set_bind_dn(arg) |