From: Douglas Bagnall Date: Wed, 31 Aug 2022 01:28:50 +0000 (+1200) Subject: samba-tool domain show: use level_to_string() X-Git-Tag: talloc-2.4.0~1156 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0363879d1fc1c76ec717467e98f2f15f5e902b09;p=thirdparty%2Fsamba.git samba-tool domain show: use level_to_string() Signed-off-by: Douglas Bagnall Reviewed-by: Andrew Bartlett --- diff --git a/python/samba/netcmd/domain.py b/python/samba/netcmd/domain.py index ef3d7c5a357..9557d7551bf 100644 --- a/python/samba/netcmd/domain.py +++ b/python/samba/netcmd/domain.py @@ -1151,58 +1151,16 @@ class cmd_domain_level(Command): self.message("") - if level_forest == DS_DOMAIN_FUNCTION_2000: - outstr = "2000" - elif level_forest == DS_DOMAIN_FUNCTION_2003_MIXED: - outstr = "2003 with mixed domains/interim (NT4 DC support)" - elif level_forest == DS_DOMAIN_FUNCTION_2003: - outstr = "2003" - elif level_forest == DS_DOMAIN_FUNCTION_2008: - outstr = "2008" - elif level_forest == DS_DOMAIN_FUNCTION_2008_R2: - outstr = "2008 R2" - elif level_forest == DS_DOMAIN_FUNCTION_2012: - outstr = "2012" - elif level_forest == DS_DOMAIN_FUNCTION_2012_R2: - outstr = "2012 R2" - else: - outstr = "higher than 2012 R2" + outstr = level_to_string(level_forest) self.message("Forest function level: (Windows) " + outstr) - if level_domain == DS_DOMAIN_FUNCTION_2000 and level_domain_mixed != 0: + if level_domain == DS_DOMAIN_FUNCTION_2000 and level_domain_mixed: outstr = "2000 mixed (NT4 DC support)" - elif level_domain == DS_DOMAIN_FUNCTION_2000 and level_domain_mixed == 0: - outstr = "2000" - elif level_domain == DS_DOMAIN_FUNCTION_2003_MIXED: - outstr = "2003 with mixed domains/interim (NT4 DC support)" - elif level_domain == DS_DOMAIN_FUNCTION_2003: - outstr = "2003" - elif level_domain == DS_DOMAIN_FUNCTION_2008: - outstr = "2008" - elif level_domain == DS_DOMAIN_FUNCTION_2008_R2: - outstr = "2008 R2" - elif level_domain == DS_DOMAIN_FUNCTION_2012: - outstr = "2012" - elif level_domain == DS_DOMAIN_FUNCTION_2012_R2: - outstr = "2012 R2" else: - outstr = "higher than 2012 R2" + outstr = level_to_string(level_domain) 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" - elif min_level_dc == DS_DOMAIN_FUNCTION_2012: - outstr = "2012" - elif min_level_dc == DS_DOMAIN_FUNCTION_2012_R2: - outstr = "2012 R2" - else: - outstr = "higher than 2012 R2" + outstr = level_to_string(min_level_dc) self.message("Lowest function level of a DC: (Windows) " + outstr) elif subcommand == "raise":