mirror of
https://github.com/samba-team/samba.git
synced 2025-12-17 04:23:50 +03:00
netcmd: apply the new get_logger to cmds
This is an example of how to use the new logger. Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
@@ -38,7 +38,6 @@ from samba.join import join_clone
|
||||
from samba.ndr import ndr_unpack
|
||||
from samba.dcerpc import drsblobs
|
||||
from samba import colour
|
||||
import logging
|
||||
|
||||
|
||||
def drsuapi_connect(ctx):
|
||||
@@ -760,13 +759,7 @@ class cmd_drs_clone_dc_database(Command):
|
||||
lp = sambaopts.get_loadparm()
|
||||
creds = credopts.get_credentials(lp)
|
||||
|
||||
logger = self.get_logger()
|
||||
if verbose:
|
||||
logger.setLevel(logging.DEBUG)
|
||||
elif quiet:
|
||||
logger.setLevel(logging.WARNING)
|
||||
else:
|
||||
logger.setLevel(logging.INFO)
|
||||
logger = self.get_logger(verbose=verbose, quiet=quiet)
|
||||
|
||||
if targetdir is None:
|
||||
raise CommandError("--targetdir option must be specified")
|
||||
|
||||
Reference in New Issue
Block a user