summaryrefslogtreecommitdiff
path: root/source4/scripting/python
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-01-24 01:05:57 +0100
committerJelmer Vernooij <jelmer@samba.org>2008-01-24 01:05:57 +0100
commit42771814530639940b3349a6b5091f9a7d19f8f7 (patch)
treeedabe60b6219776d69b48297fc2ec5c2643ebdf7 /source4/scripting/python
parent9a3cbd276bc60afa254a64216435f7448b8c453f (diff)
downloadsamba-42771814530639940b3349a6b5091f9a7d19f8f7.tar.gz
samba-42771814530639940b3349a6b5091f9a7d19f8f7.tar.bz2
samba-42771814530639940b3349a6b5091f9a7d19f8f7.zip
python: Support --no-pass.
(This used to be commit a90f3e8c420bec7fd7a39e0d5e2df6b32aedcdd5)
Diffstat (limited to 'source4/scripting/python')
-rw-r--r--source4/scripting/python/samba/getopt.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/source4/scripting/python/samba/getopt.py b/source4/scripting/python/samba/getopt.py
index dfcf2c457e..088a5acf6f 100644
--- a/source4/scripting/python/samba/getopt.py
+++ b/source4/scripting/python/samba/getopt.py
@@ -50,6 +50,7 @@ class VersionOptions(optparse.OptionGroup):
class CredentialsOptions(optparse.OptionGroup):
def __init__(self, parser):
+ self.no_pass = False
optparse.OptionGroup.__init__(self, parser, "Credentials Options")
self.add_option("--simple-bind-dn", metavar="DN", action="callback",
callback=self._set_simple_bind_dn, type=str,
@@ -62,6 +63,8 @@ class CredentialsOptions(optparse.OptionGroup):
self.add_option("-W", "--workgroup", metavar="WORKGROUP",
action="callback", type=str,
help="Workgroup", callback=self._parse_workgroup)
+ self.add_option("-N", "--no-pass", action="store_true",
+ help="Don't ask for a password")
self.creds = Credentials()
def _parse_username(self, option, opt_str, arg, parser):
@@ -77,4 +80,7 @@ class CredentialsOptions(optparse.OptionGroup):
self.creds.set_bind_dn(arg)
def get_credentials(self):
+ self.creds.guess()
+ if not self.no_pass:
+ self.creds.set_cmdline_callbacks()
return self.creds