From 305cb567f4f14ef329efc4756a17483076d9270c Mon Sep 17 00:00:00 2001 From: Amitay Isaacs Date: Fri, 12 Aug 2011 11:37:57 +1000 Subject: upgrade: Add missing bits for the s3 to s4 upgrade script Use passdb backend to import/export users Remove unused options for upgrade_from_s3 command (--blank) and credentials options Config file is specified with -s/--configfile option and no need to specify as an argument. Pair-Programmed-With: Andrew Bartlett --- source4/setup/upgrade_from_s3 | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) (limited to 'source4/setup/upgrade_from_s3') diff --git a/source4/setup/upgrade_from_s3 b/source4/setup/upgrade_from_s3 index e3af2019e6..6d7862171f 100755 --- a/source4/setup/upgrade_from_s3 +++ b/source4/setup/upgrade_from_s3 @@ -26,17 +26,13 @@ sys.path.insert(0, "bin/python") import samba import samba.getopt as options from samba.auth import system_session -from samba.upgrade import upgrade_from_passdb +from samba.upgrade import upgrade_from_samba3 from samba.samba3 import Samba3 -parser = optparse.OptionParser("upgrade_from_s3 [options] ") +parser = optparse.OptionParser("upgrade_from_s3 [options] ") sambaopts = options.SambaOptions(parser) parser.add_option_group(sambaopts) parser.add_option_group(options.VersionOptions(parser)) -credopts = options.CredentialsOptions(parser) -parser.add_option_group(credopts) parser.add_option("--quiet", help="Be quiet") -parser.add_option("--blank", - help="do not add users or groups, just the structure") parser.add_option("--targetdir", type="string", metavar="DIR", help="Set target directory") @@ -60,19 +56,12 @@ if not os.path.isdir(libdir): print "error: %s is not a directory" sys.exit(1) -if len(args) > 1: - smbconf = args[1] -else: - smbconf = os.path.join(libdir, "smb.conf") +lp = sambaopts.get_loadparm() +smbconf = lp.configfile samba3 = Samba3(libdir, smbconf) logger.info("Provisioning") -lp = sambaopts.get_loadparm() -smbconf = lp.configfile -creds = credopts.get_credentials(lp) - -upgrade_from_passdb(samba3, logger, credentials=creds, - session_info=system_session(), smbconf=smbconf, - targetdir=opts.targetdir) +upgrade_from_samba3(samba3, logger, session_info=system_session(), + smbconf=smbconf, targetdir=opts.targetdir) -- cgit