From 5f1161581084693d9c03b0d72a77856f99463b70 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 17 Oct 2011 12:22:44 +1100 Subject: s4-s3-upgrade: Give a better clue when we cannot open secrets.tdb Signed-off-by: Stefan Metzmacher --- source4/scripting/python/samba/netcmd/domain.py | 2 +- source4/scripting/python/samba/upgrade.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/source4/scripting/python/samba/netcmd/domain.py b/source4/scripting/python/samba/netcmd/domain.py index 3906d69a2d..47b7e4a8dd 100644 --- a/source4/scripting/python/samba/netcmd/domain.py +++ b/source4/scripting/python/samba/netcmd/domain.py @@ -545,7 +545,7 @@ class cmd_domain_samba3upgrade(Command): Option("--libdir", type="string", metavar="DIR", help="Path to samba3 database directory"), Option("--testparm", type="string", metavar="PATH", - help="Path to samba3 testparm utility"), + help="Path to samba3 testparm utility from the previous installation. This allows the default paths of the previous installation to be followed"), Option("--targetdir", type="string", metavar="DIR", help="Path prefix where the new Samba 4.0 AD domain should be initialised"), Option("--quiet", help="Be quiet"), diff --git a/source4/scripting/python/samba/upgrade.py b/source4/scripting/python/samba/upgrade.py index 07cb720f88..265bdbdd28 100644 --- a/source4/scripting/python/samba/upgrade.py +++ b/source4/scripting/python/samba/upgrade.py @@ -469,7 +469,10 @@ def upgrade_from_samba3(samba3, logger, targetdir, session_info=None, useeadb=Fa netbiosname = samba3.lp.get("netbios name") # secrets db - secrets_db = samba3.get_secrets_db() + try: + secrets_db = samba3.get_secrets_db() + 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)) if not domainname: domainname = secrets_db.domains()[0] -- cgit