diff options
author | Andrew Tridgell <tridge@samba.org> | 2010-04-21 12:01:47 +1000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2010-04-21 13:35:56 +1000 |
commit | 1a68311d41665b7f3ca1209ca1edf1bb92673bc4 (patch) | |
tree | 4334354c893386e4224d63add6a13bf4de98af3a /source4 | |
parent | 0c0bbf2932edc55a897029f34faee105e5b694aa (diff) | |
download | samba-1a68311d41665b7f3ca1209ca1edf1bb92673bc4.tar.gz samba-1a68311d41665b7f3ca1209ca1edf1bb92673bc4.tar.bz2 samba-1a68311d41665b7f3ca1209ca1edf1bb92673bc4.zip |
s4-python: added --realm option to python scripts
this is needed for net vampire
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4')
-rw-r--r-- | source4/scripting/python/samba/getopt.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source4/scripting/python/samba/getopt.py b/source4/scripting/python/samba/getopt.py index 6a7e099395..a9196b48f9 100644 --- a/source4/scripting/python/samba/getopt.py +++ b/source4/scripting/python/samba/getopt.py @@ -19,7 +19,7 @@ """Support for parsing Samba-related command-line options.""" -import optparse +import optparse, os from credentials import Credentials, DONT_USE_KERBEROS, MUST_USE_KERBEROS from hostconfig import Hostconfig import samba @@ -40,6 +40,9 @@ class SambaOptions(optparse.OptionGroup): self.add_option("--option", action="callback", type=str, metavar="OPTION", help="set smb.conf option from command line", callback=self._set_option) + self.add_option("--realm", action="callback", + type=str, metavar="REALM", help="set the realm name", + callback=self._set_realm) self._configfile = None self._lp = param.LoadParm() @@ -53,6 +56,9 @@ class SambaOptions(optparse.OptionGroup): def _set_debuglevel(self, option, opt_str, arg, parser): self._lp.set('debug level', str(arg)) + def _set_realm(self, option, opt_str, arg, parser): + self._lp.set('realm', arg) + def _set_option(self, option, opt_str, arg, parser): if arg.find('=') == -1: print("--option takes a 'a=b' argument") |