mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
samba-tool: Hide 'samba-tool domain samba3upgrade'.
This subcommand is provided for backwards compatibility only; new use of it should be discouraged. Its new name is 'samba-tool domain classicupgrade'. Bug: https://bugzilla.samba.org/show_bug.cgi?id=9047
This commit is contained in:
parent
98d117a542
commit
c5e83ee9a5
@ -1,5 +1,5 @@
|
||||
# Unix SMB/CIFS implementation.
|
||||
# Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2009-2011
|
||||
# Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2009-2012
|
||||
# Copyright (C) Theresa Halloran <theresahalloran@gmail.com> 2011
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
@ -70,6 +70,8 @@ class Command(object):
|
||||
takes_options = []
|
||||
takes_optiongroups = {}
|
||||
|
||||
hidden = False
|
||||
|
||||
raw_argv = None
|
||||
raw_args = None
|
||||
raw_kwargs = None
|
||||
@ -199,9 +201,11 @@ class SuperCommand(Command):
|
||||
subcmds = self.subcommands.keys()
|
||||
subcmds.sort()
|
||||
max_length = max([len(c) for c in subcmds])
|
||||
for cmd in subcmds:
|
||||
self.outf.write(" %*s - %s\n" % (
|
||||
-max_length, cmd, self.subcommands[cmd].short_description))
|
||||
for cmd_name in subcmds:
|
||||
cmd = self.subcommands[cmd_name]
|
||||
if not cmd.hidden:
|
||||
self.outf.write(" %*s - %s\n" % (
|
||||
-max_length, cmd_name, cmd.short_description))
|
||||
if subcommand in [None]:
|
||||
raise CommandError("You must specify a subcommand")
|
||||
if subcommand in ['help', '-h', '--help']:
|
||||
@ -210,7 +214,6 @@ class SuperCommand(Command):
|
||||
raise CommandError("No such subcommand '%s'" % subcommand)
|
||||
|
||||
|
||||
|
||||
class CommandError(Exception):
|
||||
"""An exception class for samba-tool Command errors."""
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
#
|
||||
# Copyright Matthias Dieter Wallnoefer 2009
|
||||
# Copyright Andrew Kroeger 2009
|
||||
# Copyright Jelmer Vernooij 2007-2009
|
||||
# Copyright Jelmer Vernooij 2007-2012
|
||||
# Copyright Giampaolo Lauria 2011
|
||||
# Copyright Matthieu Patou <mat@matws.net> 2011
|
||||
# Copyright Andrew Bartlett 2008
|
||||
@ -1230,7 +1230,7 @@ class cmd_domain_classicupgrade(Command):
|
||||
|
||||
takes_args = ["smbconf"]
|
||||
|
||||
def run(self, smbconf=None, targetdir=None, dbdir=None, testparm=None,
|
||||
def run(self, smbconf=None, targetdir=None, dbdir=None, testparm=None,
|
||||
quiet=False, verbose=False, use_xattrs=None, sambaopts=None, versionopts=None,
|
||||
dns_backend=None, use_ntvfs=False):
|
||||
|
||||
@ -1308,22 +1308,32 @@ class cmd_domain_classicupgrade(Command):
|
||||
|
||||
for p in paths:
|
||||
s3conf.set(p, paths[p])
|
||||
|
||||
|
||||
# load smb.conf parameters
|
||||
logger.info("Reading smb.conf")
|
||||
s3conf.load(smbconf)
|
||||
samba3 = Samba3(smbconf, s3conf)
|
||||
|
||||
|
||||
logger.info("Provisioning")
|
||||
upgrade_from_samba3(samba3, logger, targetdir, session_info=system_session(),
|
||||
upgrade_from_samba3(samba3, logger, targetdir, session_info=system_session(),
|
||||
useeadb=eadb, dns_backend=dns_backend, use_ntvfs=use_ntvfs)
|
||||
|
||||
|
||||
class cmd_domain_samba3upgrade(cmd_domain_classicupgrade):
|
||||
__doc__ = cmd_domain_classicupgrade.__doc__
|
||||
|
||||
# This command is present for backwards compatibility only,
|
||||
# and should not be shown.
|
||||
|
||||
hidden = True
|
||||
|
||||
|
||||
class cmd_domain(SuperCommand):
|
||||
"""Domain management"""
|
||||
|
||||
subcommands = {}
|
||||
subcommands["demote"] = cmd_domain_demote()
|
||||
if type(cmd_domain_export_keytab).__name__ != 'NoneType':
|
||||
if cmd_domain_export_keytab is not None:
|
||||
subcommands["exportkeytab"] = cmd_domain_export_keytab()
|
||||
subcommands["info"] = cmd_domain_info()
|
||||
subcommands["provision"] = cmd_domain_provision()
|
||||
@ -1332,4 +1342,4 @@ class cmd_domain(SuperCommand):
|
||||
subcommands["level"] = cmd_domain_level()
|
||||
subcommands["passwordsettings"] = cmd_domain_passwordsettings()
|
||||
subcommands["classicupgrade"] = cmd_domain_classicupgrade()
|
||||
subcommands["samba3upgrade"] = cmd_domain_classicupgrade()
|
||||
subcommands["samba3upgrade"] = cmd_domain_samba3upgrade()
|
||||
|
Loading…
Reference in New Issue
Block a user