summaryrefslogtreecommitdiffstats
path: root/source4/scripting/python/samba/getopt.py
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-09-23 19:51:36 -0700
committerAndrew Tridgell <tridge@samba.org>2010-09-25 10:38:45 -0700
commitc53210bf0609de982d0b36f76198defc8a4502da (patch)
tree9741ba4b9f9f173a075c16e0359f4c6994a9f5f1 /source4/scripting/python/samba/getopt.py
parent3d7a4cf5b68a1adcc4b7b53819ffc0c580e92da0 (diff)
downloadsamba-c53210bf0609de982d0b36f76198defc8a4502da.tar.gz
samba-c53210bf0609de982d0b36f76198defc8a4502da.tar.xz
samba-c53210bf0609de982d0b36f76198defc8a4502da.zip
s4-net: added --ipaddress option to net commands
this allows override of server IP address, bypassing NBT or DNS name resolution of DCs Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source4/scripting/python/samba/getopt.py')
-rw-r--r--source4/scripting/python/samba/getopt.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/source4/scripting/python/samba/getopt.py b/source4/scripting/python/samba/getopt.py
index 29ab8f0e010..62c94e44112 100644
--- a/source4/scripting/python/samba/getopt.py
+++ b/source4/scripting/python/samba/getopt.py
@@ -98,6 +98,7 @@ class CredentialsOptions(optparse.OptionGroup):
"""Command line options for specifying credentials."""
def __init__(self, parser):
self.no_pass = True
+ self.ipaddress = None
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,
@@ -115,6 +116,9 @@ class CredentialsOptions(optparse.OptionGroup):
self.add_option("-k", "--kerberos", metavar="KERBEROS",
action="callback", type=str,
help="Use Kerberos", callback=self._set_kerberos)
+ self.add_option("", "--ipaddress", metavar="IPADDRESS",
+ action="callback", type=str,
+ help="IP address of server", callback=self._set_ipaddress)
self.creds = Credentials()
def _parse_username(self, option, opt_str, arg, parser):
@@ -127,6 +131,9 @@ class CredentialsOptions(optparse.OptionGroup):
self.creds.set_password(arg)
self.no_pass = False
+ def _set_ipaddress(self, option, opt_str, arg, parser):
+ self.ipaddress = arg
+
def _set_kerberos(self, option, opt_str, arg, parser):
if bool(arg) or arg.lower() == "yes":
self.creds.set_kerberos_state(MUST_USE_KERBEROS)