1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-22 22:04:08 +03:00

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
This commit is contained in:
Jelmer Vernooij 2011-10-11 23:56:15 +02:00
parent b0d76efb6e
commit eb971614e5

View File

@ -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)