From b876478219b4935013a798962b95596cc45d7c9b Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 19 Jan 2009 21:14:37 +0100 Subject: Make sure server_role gets initialized in backend provisioning code - fixes test. --- source4/scripting/python/samba/provision.py | 18 +++++++++++++++++- source4/setup/provision | 2 +- source4/setup/provision-backend | 2 +- 3 files changed, 19 insertions(+), 3 deletions(-) (limited to 'source4') diff --git a/source4/scripting/python/samba/provision.py b/source4/scripting/python/samba/provision.py index 2da54ef14b..91cc074031 100644 --- a/source4/scripting/python/samba/provision.py +++ b/source4/scripting/python/samba/provision.py @@ -1195,6 +1195,9 @@ def provision_backend(setup_dir=None, message=None, lp = param.LoadParm() lp.load(smbconf) + if serverrole is None: + serverrole = lp.get("server role") + names = guess_names(lp=lp, hostname=hostname, domain=domain, dnsdomain=realm, serverrole=serverrole, rootdn=rootdn, domaindn=domaindn, configdn=configdn, @@ -1405,7 +1408,20 @@ def provision_backend(setup_dir=None, message=None, message("LDAP admin password: %s" % adminpass) message(slapdcommand) - message("Run provision with: --ldap-backend=ldapi --ldap-backend-type=" + ldap_backend_type + " --password=" + adminpass + " " + ldapuser + "--realm=" + names.dnsdomain + " --domain=" + names.domain + " --server-role='" + serverrole + "'") + assert isinstance(ldap_backend_type, str) + assert isinstance(ldapuser, str) + assert isinstance(adminpass, str) + assert isinstance(names.dnsdomain, str) + assert isinstance(names.domain, str) + assert isinstance(serverrole, str) + args = ["--ldap-backend=ldapi", + "--ldap-backend-type=" + ldap_backend_type, + "--password=" + adminpass, + ldapuser, + "--realm=" + names.dnsdomain, + "--domain=" + names.domain, + "--server-role='" + serverrole + "'"] + message("Run provision with: " + " ".join(args)) def create_phpldapadmin_config(path, setup_path, ldapi_uri): """Create a PHP LDAP admin configuration file. diff --git a/source4/setup/provision b/source4/setup/provision index 55535cfd4a..d097eb9411 100755 --- a/source4/setup/provision +++ b/source4/setup/provision @@ -160,7 +160,7 @@ if opts.server_role == "dc": elif opts.server_role == "member": server_role = "member server" else: - server_role = opts.server_role + server_role = opts.server_role creds = credopts.get_credentials(lp) diff --git a/source4/setup/provision-backend b/source4/setup/provision-backend index aad7de4327..756870d5df 100755 --- a/source4/setup/provision-backend +++ b/source4/setup/provision-backend @@ -90,7 +90,7 @@ if opts.server_role == "dc": elif opts.server_role == "member": server_role = "member server" else: - server_role = opts.server_role + server_role = opts.server_role setup_dir = opts.setupdir if setup_dir is None: -- cgit