diff options
author | Andrew Tridgell <tridge@samba.org> | 2011-06-22 20:44:35 +1000 |
---|---|---|
committer | Matthieu Patou <mat@samba.org> | 2011-06-22 20:13:08 +0200 |
commit | 9676c26fdd7ca53405abd06f58ae40d39d818e4d (patch) | |
tree | dee27a67f77b18d40b5d2bb74101e60af41cd4aa /source4/scripting/python/samba/netcmd | |
parent | 7fff636bce2576a63170bf3cc555eb85b8fefd67 (diff) | |
download | samba-9676c26fdd7ca53405abd06f58ae40d39d818e4d.tar.gz samba-9676c26fdd7ca53405abd06f58ae40d39d818e4d.tar.xz samba-9676c26fdd7ca53405abd06f58ae40d39d818e4d.zip |
samba-tool: added --attrs option to dbcheck
this allows checking of a specific list of attributes
Diffstat (limited to 'source4/scripting/python/samba/netcmd')
-rw-r--r-- | source4/scripting/python/samba/netcmd/dbcheck.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/source4/scripting/python/samba/netcmd/dbcheck.py b/source4/scripting/python/samba/netcmd/dbcheck.py index 4a4fe9cb847..b8a0055d3ab 100644 --- a/source4/scripting/python/samba/netcmd/dbcheck.py +++ b/source4/scripting/python/samba/netcmd/dbcheck.py @@ -55,11 +55,12 @@ class cmd_dbcheck(Command): help="Print more details of checking"), Option("--quiet", dest="quiet", action="store_true", default=False, help="don't print details of checking"), + Option("--attrs", dest="attrs", default=None, help="list of attributes to check (space separated)"), Option("-H", help="LDB URL for database or target server (defaults to local SAM database)", type=str), ] def run(self, H=None, DN=None, verbose=False, fix=False, yes=False, cross_ncs=False, quiet=False, - scope="SUB", credopts=None, sambaopts=None, versionopts=None): + scope="SUB", credopts=None, sambaopts=None, versionopts=None, attrs=None): lp = sambaopts.get_loadparm() creds = credopts.get_credentials(lp, fallback_machine=True) @@ -84,11 +85,16 @@ class cmd_dbcheck(Command): if cross_ncs: controls.append("search_options:1:2") + if not attrs: + attrs = ['*'] + else: + attrs = attrs.split() + if yes and fix: samdb.transaction_start() chk = dbcheck(samdb, samdb_schema=samdb_schema, verbose=verbose, fix=fix, yes=yes, quiet=quiet) - error_count = chk.check_database(DN=DN, scope=search_scope, controls=controls) + error_count = chk.check_database(DN=DN, scope=search_scope, controls=controls, attrs=attrs) if yes and fix: samdb.transaction_commit() |