mirror of
https://github.com/samba-team/samba.git
synced 2025-08-02 00:22:11 +03:00
s4-s3-upgrade rename samba-tool domain samba3upgrade --libdir to --dbdir for clarity
The things pointed at are not typically in a directory called lib, so avoid confusing our administrators. Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Wed Oct 19 15:43:04 CEST 2011 on sn-devel-104
This commit is contained in:
@ -530,7 +530,7 @@ class cmd_domain_passwordsettings(Command):
|
|||||||
class cmd_domain_samba3upgrade(Command):
|
class cmd_domain_samba3upgrade(Command):
|
||||||
"""Upgrade from Samba3 database to Samba4 AD database.
|
"""Upgrade from Samba3 database to Samba4 AD database.
|
||||||
|
|
||||||
Specify either samba3 database directory (with --libdir) or
|
Specify either a directory with all samba3 databases and state files (with --dbdir) or
|
||||||
samba3 testparm utility (with --testparm).
|
samba3 testparm utility (with --testparm).
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@ -542,7 +542,7 @@ class cmd_domain_samba3upgrade(Command):
|
|||||||
}
|
}
|
||||||
|
|
||||||
takes_options = [
|
takes_options = [
|
||||||
Option("--libdir", type="string", metavar="DIR",
|
Option("--dbdir", type="string", metavar="DIR",
|
||||||
help="Path to samba3 database directory"),
|
help="Path to samba3 database directory"),
|
||||||
Option("--testparm", type="string", metavar="PATH",
|
Option("--testparm", type="string", metavar="PATH",
|
||||||
help="Path to samba3 testparm utility from the previous installation. This allows the default paths of the previous installation to be followed"),
|
help="Path to samba3 testparm utility from the previous installation. This allows the default paths of the previous installation to be followed"),
|
||||||
@ -555,7 +555,7 @@ class cmd_domain_samba3upgrade(Command):
|
|||||||
|
|
||||||
takes_args = ["smbconf"]
|
takes_args = ["smbconf"]
|
||||||
|
|
||||||
def run(self, smbconf=None, targetdir=None, libdir=None, testparm=None,
|
def run(self, smbconf=None, targetdir=None, dbdir=None, testparm=None,
|
||||||
quiet=None, use_xattrs=None, sambaopts=None, versionopts=None):
|
quiet=None, use_xattrs=None, sambaopts=None, versionopts=None):
|
||||||
|
|
||||||
if not os.path.exists(smbconf):
|
if not os.path.exists(smbconf):
|
||||||
@ -564,15 +564,15 @@ class cmd_domain_samba3upgrade(Command):
|
|||||||
if testparm and not os.path.exists(testparm):
|
if testparm and not os.path.exists(testparm):
|
||||||
raise CommandError("Testparm utility %s does not exist" % testparm)
|
raise CommandError("Testparm utility %s does not exist" % testparm)
|
||||||
|
|
||||||
if libdir and not os.path.exists(libdir):
|
if dbdir and not os.path.exists(dbdir):
|
||||||
raise CommandError("Directory %s does not exist" % libdir)
|
raise CommandError("Directory %s does not exist" % dbdir)
|
||||||
|
|
||||||
if not libdir and not testparm:
|
if not dbdir and not testparm:
|
||||||
raise CommandError("Please specify either libdir or testparm")
|
raise CommandError("Please specify either dbdir or testparm")
|
||||||
|
|
||||||
if libdir and testparm:
|
if dbdir and testparm:
|
||||||
self.outf.write("warning: both libdir and testparm specified, ignoring libdir.\n")
|
self.outf.write("warning: both dbdir and testparm specified, ignoring dbdir.\n")
|
||||||
libdir = None
|
dbdir = None
|
||||||
|
|
||||||
logger = self.get_logger()
|
logger = self.get_logger()
|
||||||
if quiet:
|
if quiet:
|
||||||
@ -605,12 +605,12 @@ class cmd_domain_samba3upgrade(Command):
|
|||||||
"If you intend to use this provision in production, rerun the script as root on a system supporting xattrs.")
|
"If you intend to use this provision in production, rerun the script as root on a system supporting xattrs.")
|
||||||
tmpfile.close()
|
tmpfile.close()
|
||||||
|
|
||||||
# Set correct default values from libdir or testparm
|
# Set correct default values from dbdir or testparm
|
||||||
paths = {}
|
paths = {}
|
||||||
if libdir:
|
if dbdir:
|
||||||
paths["state directory"] = libdir
|
paths["state directory"] = dbdir
|
||||||
paths["private dir"] = libdir
|
paths["private dir"] = dbdir
|
||||||
paths["lock directory"] = libdir
|
paths["lock directory"] = dbdir
|
||||||
else:
|
else:
|
||||||
paths["state directory"] = get_testparm_var(testparm, smbconf, "state directory")
|
paths["state directory"] = get_testparm_var(testparm, smbconf, "state directory")
|
||||||
paths["private dir"] = get_testparm_var(testparm, smbconf, "private dir")
|
paths["private dir"] = get_testparm_var(testparm, smbconf, "private dir")
|
||||||
|
@ -473,7 +473,7 @@ def upgrade_from_samba3(samba3, logger, targetdir, session_info=None, useeadb=Fa
|
|||||||
try:
|
try:
|
||||||
secrets_db = samba3.get_secrets_db()
|
secrets_db = samba3.get_secrets_db()
|
||||||
except IOError, e:
|
except IOError, e:
|
||||||
raise ProvisioningError("Could not open '%s', the Samba3 secrets database: %s. Perhaps you specified the incorrect smb.conf, --testparm or --libdir option?" % (samba3.privatedir_path("secrets.tdb"), str(e)))
|
raise ProvisioningError("Could not open '%s', the Samba3 secrets database: %s. Perhaps you specified the incorrect smb.conf, --testparm or --dbdir option?" % (samba3.privatedir_path("secrets.tdb"), str(e)))
|
||||||
|
|
||||||
if not domainname:
|
if not domainname:
|
||||||
domainname = secrets_db.domains()[0]
|
domainname = secrets_db.domains()[0]
|
||||||
|
@ -38,7 +38,7 @@ cat - > $PREFIX/samba3-upgrade/samba3/smb1.conf <<EOF
|
|||||||
debug level = 0
|
debug level = 0
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
testit "samba3-upgrade-member" $samba_tool domain samba3upgrade $PREFIX/samba3-upgrade/samba3/smb1.conf --targetdir=$PREFIX/samba3-upgrade/s4_1 --libdir=$PREFIX/samba3-upgrade/samba3
|
testit "samba3-upgrade-member" $samba_tool domain samba3upgrade $PREFIX/samba3-upgrade/samba3/smb1.conf --targetdir=$PREFIX/samba3-upgrade/s4_1 --dbdir=$PREFIX/samba3-upgrade/samba3
|
||||||
|
|
||||||
# Test 2 (s3 dc)
|
# Test 2 (s3 dc)
|
||||||
cat - > $PREFIX/samba3-upgrade/samba3/smb2.conf <<EOF
|
cat - > $PREFIX/samba3-upgrade/samba3/smb2.conf <<EOF
|
||||||
@ -59,7 +59,7 @@ cat - > $PREFIX/samba3-upgrade/samba3/smb2.conf <<EOF
|
|||||||
domain logons = yes
|
domain logons = yes
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
testit "samba3-upgrade-dc" $samba_tool domain samba3upgrade $PREFIX/samba3-upgrade/samba3/smb2.conf --targetdir=$PREFIX/samba3-upgrade/s4_2 --libdir=$PREFIX/samba3-upgrade/samba3
|
testit "samba3-upgrade-dc" $samba_tool domain samba3upgrade $PREFIX/samba3-upgrade/samba3/smb2.conf --targetdir=$PREFIX/samba3-upgrade/s4_2 --dbdir=$PREFIX/samba3-upgrade/samba3
|
||||||
|
|
||||||
#Run final test without a wins.dat
|
#Run final test without a wins.dat
|
||||||
rm -f $PREFIX/samba3-upgrade/samba3/wins.dat
|
rm -f $PREFIX/samba3-upgrade/samba3/wins.dat
|
||||||
|
Reference in New Issue
Block a user