Use fqdn rather than gethostname when guessing realm.
[ira/wip.git] / source4 / setup / provision
index 4b48bab676e14b0a81f08e2c5ab7e6992c1c24e5..55a438cb659a1032f922167cc36faebc4b2666a3 100755 (executable)
@@ -129,7 +129,7 @@ if opts.interactive:
                else:
                        print "%s: " % (prompt,),
                return sys.stdin.readline().rstrip("\n") or default
-       opts.realm = ask("Realm", socket.gethostname().split(".", 1)[1].upper())
+       opts.realm = ask("Realm", socket.getfqdn().split(".", 1)[1].upper())
        opts.domain = ask("Domain", opts.realm.split(".")[0])
        opts.server_role = ask("Server Role (dc, member, standalone)", "dc")
        for i in range(3):
@@ -140,7 +140,7 @@ if opts.interactive:
                        break
 
 lp = sambaopts.get_loadparm()
-smbconf = lp.configfile()
+smbconf = lp.configfile
 
 if opts.aci is not None:
        print "set ACI: %s" % opts.aci
@@ -166,8 +166,9 @@ if opts.blank:
 elif opts.partitions_only:
     samdb_fill = FILL_DRS
 
+session = system_session()
 provision(setup_dir, message, 
-          system_session(), creds, smbconf=smbconf, targetdir=opts.targetdir,
+          session, creds, smbconf=smbconf, targetdir=opts.targetdir,
           samdb_fill=samdb_fill, realm=opts.realm, domain=opts.domain,
           domainguid=opts.domain_guid, domainsid=opts.domain_sid,
           policyguid=opts.policy_guid, hostname=opts.host_name,