s4-s3-upgrade: Give a better clue when we cannot open secrets.tdb
authorAndrew Bartlett <abartlet@samba.org>
Mon, 17 Oct 2011 01:22:44 +0000 (12:22 +1100)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 18 Oct 2011 02:13:31 +0000 (13:13 +1100)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
source4/scripting/python/samba/netcmd/domain.py
source4/scripting/python/samba/upgrade.py

index 3906d69a2d3e0f7e510f1d2e77103b6d61dacd42..47b7e4a8ddab6b8fc20a21ae33b6eb92592e6072 100644 (file)
@@ -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"),
index 07cb720f88953946a658c00db8603a8995ee1d7c..265bdbdd28346f028d75358d40e3c149c963d3bd 100644 (file)
@@ -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]