summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorGiampaolo Lauria <lauria2@yahoo.com>2011-07-25 11:56:10 -0400
committerAndrew Tridgell <tridge@samba.org>2011-07-28 15:20:51 +1000
commit41f073eb601f83e89bd1d2eba7905fede869a5ae (patch)
tree703446cd60c8aacb61db5f723765e87dfe90c70d /source4
parent2e082853fbbec127b99e97ea785b564f6aa774d7 (diff)
downloadsamba-41f073eb601f83e89bd1d2eba7905fede869a5ae.tar.gz
samba-41f073eb601f83e89bd1d2eba7905fede869a5ae.tar.bz2
samba-41f073eb601f83e89bd1d2eba7905fede869a5ae.zip
samba-tool: add -H or --URL where necessary
To improve consistency, I've made sure all the commands take either a -H or --URL when specifying a URL Signed-off-by: Andrew Tridgell <tridge@samba.org>
Diffstat (limited to 'source4')
-rw-r--r--source4/scripting/python/samba/netcmd/dbcheck.py3
-rw-r--r--source4/scripting/python/samba/netcmd/domain.py6
-rw-r--r--source4/scripting/python/samba/netcmd/dsacl.py8
-rw-r--r--source4/scripting/python/samba/netcmd/fsmo.py7
-rw-r--r--source4/scripting/python/samba/netcmd/gpo.py6
-rw-r--r--source4/scripting/python/samba/netcmd/group.py12
-rw-r--r--source4/scripting/python/samba/netcmd/user.py9
7 files changed, 32 insertions, 19 deletions
diff --git a/source4/scripting/python/samba/netcmd/dbcheck.py b/source4/scripting/python/samba/netcmd/dbcheck.py
index 299879b2c6..3f379c0cd4 100644
--- a/source4/scripting/python/samba/netcmd/dbcheck.py
+++ b/source4/scripting/python/samba/netcmd/dbcheck.py
@@ -52,7 +52,8 @@ class cmd_dbcheck(Command):
help="don't print details of checking"),
Option("--attrs", dest="attrs", default=None, help="list of attributes to check (space separated)"),
Option("--reindex", dest="reindex", default=False, action="store_true", help="force database re-index"),
- Option("-H", help="LDB URL for database or target server (defaults to local SAM database)", type=str),
+ Option("-H", "--URL", help="LDB URL for database or target server (defaults to local SAM database)",
+ type=str, metavar="URL", dest="H"),
]
def run(self, DN=None, H=None, verbose=False, fix=False, yes=False, cross_ncs=False, quiet=False,
diff --git a/source4/scripting/python/samba/netcmd/domain.py b/source4/scripting/python/samba/netcmd/domain.py
index 680cfe9d10..8dffbd2b56 100644
--- a/source4/scripting/python/samba/netcmd/domain.py
+++ b/source4/scripting/python/samba/netcmd/domain.py
@@ -119,7 +119,8 @@ class cmd_domain_level(Command):
synopsis = "%prog domain level (show | raise <options>)"
takes_options = [
- Option("-H", help="LDB URL for database or target server", type=str),
+ Option("-H", "--URL", help="LDB URL for database or target server", type=str,
+ metavar="URL", dest="H"),
Option("--quiet", help="Be quiet", action="store_true"),
Option("--forest", type="choice", choices=["2003", "2008", "2008_R2"],
help="The forest function level (2003 | 2008 | 2008_R2)"),
@@ -335,7 +336,8 @@ class cmd_domain_passwordsettings(Command):
synopsis = "%prog domain passwordsettings (show | set <options>)"
takes_options = [
- Option("-H", help="LDB URL for database or target server", type=str),
+ Option("-H", "--URL", help="LDB URL for database or target server", type=str,
+ metavar="URL", dest="H"),
Option("--quiet", help="Be quiet", action="store_true"),
Option("--complexity", type="choice", choices=["on","off","default"],
help="The password complexity (on | off | default). Default is 'on'"),
diff --git a/source4/scripting/python/samba/netcmd/dsacl.py b/source4/scripting/python/samba/netcmd/dsacl.py
index 5eee235b41..f4f33561b5 100644
--- a/source4/scripting/python/samba/netcmd/dsacl.py
+++ b/source4/scripting/python/samba/netcmd/dsacl.py
@@ -52,8 +52,8 @@ class cmd_ds_acl_set(Command):
car_help = """ The access control right to allow or deny """
takes_options = [
- Option("--host", help="LDB URL for database or target server",
- type=str),
+ Option("-H", "--URL", help="LDB URL for database or target server",
+ type=str, metavar="URL", dest="H"),
Option("--car", type="choice", choices=["change-rid",
"change-pdc",
"change-infrastructure",
@@ -131,7 +131,7 @@ class cmd_ds_acl_set(Command):
print desc_sddl
def run(self, car, action, objectdn, trusteedn, sddl,
- host=None, credopts=None, sambaopts=None, versionopts=None):
+ H=None, credopts=None, sambaopts=None, versionopts=None):
lp = sambaopts.get_loadparm()
creds = credopts.get_credentials(lp)
@@ -139,7 +139,7 @@ class cmd_ds_acl_set(Command):
or objectdn is None or trusteedn is None):
return self.usage()
- samdb = SamDB(url=host, session_info=system_session(),
+ samdb = SamDB(url=H, session_info=system_session(),
credentials=creds, lp=lp)
cars = {'change-rid' : GUID_DRS_CHANGE_RID_MASTER,
'change-pdc' : GUID_DRS_CHANGE_PDC,
diff --git a/source4/scripting/python/samba/netcmd/fsmo.py b/source4/scripting/python/samba/netcmd/fsmo.py
index aaf7d138e6..d709cc8fda 100644
--- a/source4/scripting/python/samba/netcmd/fsmo.py
+++ b/source4/scripting/python/samba/netcmd/fsmo.py
@@ -38,7 +38,8 @@ class cmd_fsmo(Command):
synopsis = "(show | transfer <options> | seize <options>)"
takes_options = [
- Option("--url", help="LDB URL for database or target server", type=str),
+ Option("-H", "--URL", help="LDB URL for database or target server", type=str,
+ metavar="URL", dest="H"),
Option("--force", help="Force seizing of the role without attempting to transfer first.", action="store_true"),
Option("--role", type="choice", choices=["rid", "pdc", "infrastructure","schema","naming","all"],
help="""The FSMO role to seize or transfer.\n
@@ -132,12 +133,12 @@ all=all of the above"""),
print("FSMO transfer of '%s' role successful" % role)
- def run(self, subcommand, force=None, url=None, role=None,
+ def run(self, subcommand, force=None, H=None, role=None,
credopts=None, sambaopts=None, versionopts=None):
lp = sambaopts.get_loadparm()
creds = credopts.get_credentials(lp, fallback_machine=True)
- samdb = SamDB(url=url, session_info=system_session(),
+ samdb = SamDB(url=H, session_info=system_session(),
credentials=creds, lp=lp)
domain_dn = samdb.domain_dn()
diff --git a/source4/scripting/python/samba/netcmd/gpo.py b/source4/scripting/python/samba/netcmd/gpo.py
index 2a6bef0f37..1301548b67 100644
--- a/source4/scripting/python/samba/netcmd/gpo.py
+++ b/source4/scripting/python/samba/netcmd/gpo.py
@@ -90,7 +90,8 @@ class cmd_listall(Command):
synopsis = "%prog gpo listall"
takes_options = [
- Option("-H", help="LDB URL for database or target server", type=str)
+ Option("-H", "--URL", help="LDB URL for database or target server", type=str,
+ metavar="URL", dest="H")
]
def run(self, H=None, sambaopts=None,
@@ -134,7 +135,8 @@ class cmd_list(Command):
takes_args = [ 'username' ]
takes_options = [
- Option("-H", help="LDB URL for database or target server", type=str)
+ Option("-H", "--URL", help="LDB URL for database or target server", type=str,
+ metavar="URL", dest="H")
]
def run(self, username, H=None, sambaopts=None,
diff --git a/source4/scripting/python/samba/netcmd/group.py b/source4/scripting/python/samba/netcmd/group.py
index 7f3b6cdef9..df8cf7c87a 100644
--- a/source4/scripting/python/samba/netcmd/group.py
+++ b/source4/scripting/python/samba/netcmd/group.py
@@ -46,7 +46,8 @@ class cmd_group_add(Command):
synopsis = "%prog group add [options] <groupname>"
takes_options = [
- Option("-H", help="LDB URL for database or target server", type=str),
+ Option("-H", "--URL", help="LDB URL for database or target server", type=str,
+ metavar="URL", dest="H"),
Option("--groupou",
help="Alternative location (without domainDN counterpart) to default CN=Users in which new user object will be created",
type=str),
@@ -89,7 +90,8 @@ class cmd_group_delete(Command):
synopsis = "%prog group delete <groupname>"
takes_options = [
- Option("-H", help="LDB URL for database or target server", type=str),
+ Option("-H", "--URL", help="LDB URL for database or target server", type=str,
+ metavar="URL", dest="H"),
]
takes_args = ["groupname"]
@@ -114,7 +116,8 @@ class cmd_group_add_members(Command):
synopsis = "%prog group addmembers <groupname> <listofmembers>"
takes_options = [
- Option("-H", help="LDB URL for database or target server", type=str),
+ Option("-H", "--URL", help="LDB URL for database or target server", type=str,
+ metavar="URL", dest="H"),
]
takes_args = ["groupname", "listofmembers"]
@@ -140,7 +143,8 @@ class cmd_group_remove_members(Command):
synopsis = "%prog group removemembers <groupname> <listofmembers>"
takes_options = [
- Option("-H", help="LDB URL for database or target server", type=str),
+ Option("-H", "--URL", help="LDB URL for database or target server", type=str,
+ metavar="URL", dest="H"),
]
takes_args = ["groupname", "listofmembers"]
diff --git a/source4/scripting/python/samba/netcmd/user.py b/source4/scripting/python/samba/netcmd/user.py
index 3b772de87a..1b65777ce1 100644
--- a/source4/scripting/python/samba/netcmd/user.py
+++ b/source4/scripting/python/samba/netcmd/user.py
@@ -83,7 +83,8 @@ class cmd_user_enable(Command):
synopsis = "%prog user enable (<username>|--filter <filter>) [options]"
takes_options = [
- Option("-H", help="LDB URL for database or target server", type=str, metavar="URL"),
+ Option("-H", "--URL", help="LDB URL for database or target server", type=str,
+ metavar="URL", dest="H"),
Option("--filter", help="LDAP Filter to set password on", type=str),
]
@@ -116,7 +117,8 @@ class cmd_user_setexpiry(Command):
synopsis = "%prog user setexpiry (<username>|--filter <filter>) [options]"
takes_options = [
- Option("-H", help="LDB URL for database or target server", type=str, metavar="URL"),
+ Option("-H", "--URL", help="LDB URL for database or target server", type=str,
+ metavar="URL", dest="H"),
Option("--filter", help="LDAP Filter to set password on", type=str),
Option("--days", help="Days to expiry", type=int, default=0),
Option("--noexpiry", help="Password does never expire", action="store_true", default=False),
@@ -151,7 +153,8 @@ class cmd_user_setpassword(Command):
synopsis = "%prog user setpassword (<username>|--filter <filter>) [options]"
takes_options = [
- Option("-H", help="LDB URL for database or target server", type=str, metavar="URL"),
+ Option("-H", "--URL", help="LDB URL for database or target server", type=str,
+ metavar="URL", dest="H"),
Option("--filter", help="LDAP Filter to set password on", type=str),
Option("--newpassword", help="Set password", type=str),
Option("--must-change-at-next-login",