The branch, v4-0-test has been updated
       via  d331bc400fb138bc43be88d0ca8ab3bcd590d2cd (commit)
      from  0923de12282b0e063dd73bc3e056dd5c3663c190 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v4-0-test


- Log -----------------------------------------------------------------
commit d331bc400fb138bc43be88d0ca8ab3bcd590d2cd
Author: Andrew Bartlett <[EMAIL PROTECTED]>
Date:   Fri Mar 7 19:20:39 2008 +1100

    Try to fix up part of the upgrade test.
    
    There are still problems with the upgrade test, but these are not
    related to the provision system.
    
    Andrew Bartlett

-----------------------------------------------------------------------

Summary of changes:
 source/scripting/python/samba/provision.py |   13 ++++++++++++-
 source/scripting/python/samba/upgrade.py   |   20 +++++++++-----------
 source/setup/upgrade.py                    |   12 ++----------
 3 files changed, 23 insertions(+), 22 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/scripting/python/samba/provision.py 
b/source/scripting/python/samba/provision.py
index 25c1a99..ebca1f8 100644
--- a/source/scripting/python/samba/provision.py
+++ b/source/scripting/python/samba/provision.py
@@ -68,6 +68,12 @@ class ProvisionPaths:
         self.winsdb = None
         self.private_dir = None
 
+class ProvisionResult:
+    def __init__(self):
+        self.paths = None
+        self.domaindn = None
+        self.lp = None
+        self.samdb = None
 
 def check_install(lp, session_info, credentials):
     """Check whether the current install seems ok.
@@ -991,7 +997,12 @@ def provision(setup_dir, message, session_info,
 
     message("Please install the phpLDAPadmin configuration located at %s into 
/etc/phpldapadmin/config.php" % paths.phpldapadminconfig)
 
-    return domaindn
+    result = ProvisionResult()
+    result.domaindn = domaindn
+    result.paths = paths
+    result.lp = lp
+    result.samdb = samdb
+    return result
 
 def provision_become_dc(setup_dir=None,
                         smbconf=None, targetdir=None, realm=None, 
diff --git a/source/scripting/python/samba/upgrade.py 
b/source/scripting/python/samba/upgrade.py
index c508684..f40f2cf 100644
--- a/source/scripting/python/samba/upgrade.py
+++ b/source/scripting/python/samba/upgrade.py
@@ -207,7 +207,7 @@ def import_wins(samba4_winsdb, samba3_winsdb):
                        "objectClass": "winsMaxVersion",
                        "maxVersion": str(version_id)})
 
-def upgrade_provision(samba3, setup_dir, message, credentials, session_info, 
lp, paths):
+def upgrade_provision(samba3, setup_dir, message, credentials, session_info, 
smbconf, targetdir):
     oldconf = samba3.get_conf()
 
     if oldconf.get("domain logons") == "True":
@@ -244,15 +244,13 @@ def upgrade_provision(samba3, setup_dir, message, 
credentials, session_info, lp,
     else:
         machinepass = None
     
-    domaindn = provision(setup_dir=setup_dir, message=message, 
-                         samdb_fill=FILL_DRS, paths=paths, 
session_info=session_info, 
-                         credentials=credentials, realm=realm, 
-                         domain=domainname, domainsid=domainsid, 
domainguid=domainguid, 
-                         machinepass=machinepass, serverrole=serverrole)
+    result = provision(setup_dir=setup_dir, message=message, 
+                       samdb_fill=FILL_DRS, smbconf=smbconf, 
session_info=session_info, 
+                       credentials=credentials, realm=realm, 
+                       domain=domainname, domainsid=domainsid, 
domainguid=domainguid, 
+                       machinepass=machinepass, serverrole=serverrole, 
targetdir=targetdir)
 
-    samdb = SamDB(paths.samdb, credentials=credentials, lp=lp, 
session_info=session_info)
-
-    import_wins(Ldb(paths.winsdb), samba3.get_wins_db())
+    import_wins(Ldb(result.paths.winsdb), samba3.get_wins_db())
 
     # FIXME: import_registry(registry.Registry(), samba3.get_registry())
 
@@ -268,12 +266,12 @@ def upgrade_provision(samba3, setup_dir, message, 
credentials, session_info, lp,
     passdb = samba3.get_sam_db()
     for name in passdb:
         user = passdb[name]
-        #FIXME: import_sam_account(samdb, user, domaindn, domainsid)
+        #FIXME: import_sam_account(result.samdb, user, domaindn, domainsid)
 
     if hasattr(passdb, 'ldap_url'):
         message("Enabling Samba3 LDAP mappings for SAM database")
 
-        enable_samba3sam(samdb, passdb.ldap_url)
+        enable_samba3sam(result.samdb, passdb.ldap_url)
 
 
 def enable_samba3sam(samdb, ldapurl):
diff --git a/source/setup/upgrade.py b/source/setup/upgrade.py
index 960cd1b..569b179 100755
--- a/source/setup/upgrade.py
+++ b/source/setup/upgrade.py
@@ -50,7 +50,6 @@ else:
 samba3 = Samba3(libdir, smbconf)
 
 from samba.upgrade import upgrade_provision
-from samba.provision import provision_paths_from_lp
 
 message("Provisioning\n")
 
@@ -59,13 +58,6 @@ if setup_dir is None:
        setup_dir = "setup"
 
 creds = credopts.get_credentials()
-lp = sambaopts.get_loadparm()
-if opts.targetdir is not None:
-    if not os.path.exists(opts.targetdir):
-        os.mkdir(opts.targetdir)
-    lp.set("private dir", os.path.abspath(opts.targetdir))
-    lp.set("lock dir", os.path.abspath(opts.targetdir))
-paths = provision_paths_from_lp(lp, "")
-paths.smbconf = sambaopts.get_loadparm_path()
+
 upgrade_provision(samba3, setup_dir, message, credentials=creds, 
session_info=system_session(), 
-                  lp=lp, paths=paths)
+                  smbconf=sambaopts.get_loadparm_path(), 
targetdir=opts.targetdir)


-- 
Samba Shared Repository

Reply via email to