diff options
author | Matthias Dieter Wallnöfer <mdw@samba.org> | 2011-09-09 15:27:25 +0200 |
---|---|---|
committer | Matthias Dieter Wallnöfer <mdw@samba.org> | 2011-09-11 17:33:12 +0200 |
commit | 7e460a04f79c9056b7b0b6c927caa2db96229633 (patch) | |
tree | a19443223124635b418c3e63043255fed7020824 /source4 | |
parent | 80f6932e3ef4cfc25b6ed717ba2f499314ec5226 (diff) | |
download | samba-7e460a04f79c9056b7b0b6c927caa2db96229633.tar.gz samba-7e460a04f79c9056b7b0b6c927caa2db96229633.tar.bz2 samba-7e460a04f79c9056b7b0b6c927caa2db96229633.zip |
s4:samba-tool/domain.py - restore domain raise functionality
The samba-tool command has accidentally been damaged by commit
2d4988c3d79e501003875cd26b7f9aaa72402b31.
Reviewed-by: Jelmer
Diffstat (limited to 'source4')
-rw-r--r-- | source4/scripting/python/samba/netcmd/domain.py | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/source4/scripting/python/samba/netcmd/domain.py b/source4/scripting/python/samba/netcmd/domain.py index 884ea64b9f..20beea0fb5 100644 --- a/source4/scripting/python/samba/netcmd/domain.py +++ b/source4/scripting/python/samba/netcmd/domain.py @@ -131,6 +131,8 @@ class cmd_domain_level(Command): 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)"), + Option("--domain", type="choice", choices=["2003", "2008", "2008_R2"], + help="The domain function level (2003 | 2008 | 2008_R2)") ] takes_args = ["subcommand"] @@ -219,6 +221,18 @@ class cmd_domain_level(Command): outstr = "2008 R2" else: outstr = "higher than 2008 R2" + self.message("Domain function level: (Windows) " + outstr) + + if min_level_dc == DS_DOMAIN_FUNCTION_2000: + outstr = "2000" + elif min_level_dc == DS_DOMAIN_FUNCTION_2003: + outstr = "2003" + elif min_level_dc == DS_DOMAIN_FUNCTION_2008: + outstr = "2008" + elif min_level_dc == DS_DOMAIN_FUNCTION_2008_R2: + outstr = "2008 R2" + else: + outstr = "higher than 2008 R2" self.message("Lowest function level of a DC: (Windows) " + outstr) elif subcommand == "raise": @@ -261,7 +275,8 @@ class cmd_domain_level(Command): # Directly on the base DN m = ldb.Message() m.dn = ldb.Dn(samdb, domain_dn) - m["msDS-Behavior-Version"]= ldb.MessageElement( str(new_level_domain), ldb.FLAG_MOD_REPLACE, + m["msDS-Behavior-Version"]= ldb.MessageElement( + str(new_level_domain), ldb.FLAG_MOD_REPLACE, "msDS-Behavior-Version") samdb.modify(m) # Under partitions |