summaryrefslogtreecommitdiff
path: root/source4/setup
diff options
context:
space:
mode:
authorAmitay Isaacs <amitay@gmail.com>2011-08-12 11:37:57 +1000
committerAndrew Bartlett <abartlet@samba.org>2011-08-13 20:18:40 +1000
commit305cb567f4f14ef329efc4756a17483076d9270c (patch)
tree8f78eb7b260bffc8a6e937a6559c18d86dec008d /source4/setup
parent64ec42d64f0a6029b135c49cfeb8bc5c6f8cbdbe (diff)
downloadsamba-305cb567f4f14ef329efc4756a17483076d9270c.tar.gz
samba-305cb567f4f14ef329efc4756a17483076d9270c.tar.bz2
samba-305cb567f4f14ef329efc4756a17483076d9270c.zip
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 <abartlet@samba.org>
Diffstat (limited to 'source4/setup')
-rwxr-xr-xsource4/setup/upgrade_from_s323
1 files changed, 6 insertions, 17 deletions
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] <libdir> <smbconf>")
+parser = optparse.OptionParser("upgrade_from_s3 [options] <libdir>")
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)