summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-06-11 10:50:08 +1000
committerAndrew Bartlett <abartlet@samba.org>2012-06-15 09:18:33 +0200
commit67bdf4fa11f097144a831b51c424bdac3618a927 (patch)
treec63ecbf054a2f571a630e7a56421c712ba622b39 /source4
parent11db5b1f3321b3d5b73bb16f4030111c9a35fbbe (diff)
downloadsamba-67bdf4fa11f097144a831b51c424bdac3618a927.tar.gz
samba-67bdf4fa11f097144a831b51c424bdac3618a927.tar.bz2
samba-67bdf4fa11f097144a831b51c424bdac3618a927.zip
lib/param: Use server role = 'standalone server' to be consistant with member server
standalne is left as an alias. Andrew Bartlett
Diffstat (limited to 'source4')
-rw-r--r--source4/scripting/python/samba/provision/__init__.py11
-rw-r--r--source4/scripting/python/samba/tests/provision.py7
2 files changed, 11 insertions, 7 deletions
diff --git a/source4/scripting/python/samba/provision/__init__.py b/source4/scripting/python/samba/provision/__init__.py
index 343e33e355..26d20d97b6 100644
--- a/source4/scripting/python/samba/provision/__init__.py
+++ b/source4/scripting/python/samba/provision/__init__.py
@@ -603,7 +603,7 @@ def make_smbconf(smbconf, hostname, domain, realm, targetdir,
netbiosname = determine_netbios_name(hostname)
if serverrole is None:
- serverrole = "standalone"
+ serverrole = "standalone server"
if sid_generator is None:
sid_generator = "internal"
@@ -1566,7 +1566,7 @@ def provision_fill(samdb, secrets_ldb, logger, names, paths,
_ROLES_MAP = {
- "ROLE_STANDALONE": "standalone",
+ "ROLE_STANDALONE": "standalone server",
"ROLE_DOMAIN_MEMBER": "member server",
"ROLE_DOMAIN_BDC": "active directory domain controller",
"ROLE_DOMAIN_PDC": "active directory domain controller",
@@ -1575,7 +1575,8 @@ _ROLES_MAP = {
"domain controller": "active directory domain controller",
"active directory domain controller": "active directory domain controller",
"member server": "member server",
- "standalone": "standalone",
+ "standalone": "standalone server",
+ "standalone server": "standalone server",
}
@@ -1585,7 +1586,7 @@ def sanitize_server_role(role):
:param role: Server role
:raise ValueError: If the role can not be interpreted
:return: Sanitized server role (one of "member server",
- "active directory domain controller", "standalone")
+ "active directory domain controller", "standalone server")
"""
try:
return _ROLES_MAP[role]
@@ -1615,7 +1616,7 @@ def provision(logger, session_info, credentials, smbconf=None,
try:
serverrole = sanitize_server_role(serverrole)
except ValueError:
- raise ProvisioningError('server role (%s) should be one of "active directory domain controller", "member server", "standalone"' % serverrole)
+ raise ProvisioningError('server role (%s) should be one of "active directory domain controller", "member server", "standalone server"' % serverrole)
if ldapadminpass is None:
# Make a new, random password between Samba and it's LDAP server
diff --git a/source4/scripting/python/samba/tests/provision.py b/source4/scripting/python/samba/tests/provision.py
index 6ea3e60fb0..cfb6ded3c7 100644
--- a/source4/scripting/python/samba/tests/provision.py
+++ b/source4/scripting/python/samba/tests/provision.py
@@ -124,7 +124,8 @@ class Disabled(object):
class SanitizeServerRoleTests(TestCase):
def test_same(self):
- self.assertEquals("standalone", sanitize_server_role("standalone"))
+ self.assertEquals("standalone server",
+ sanitize_server_role("standalone server"))
self.assertEquals("member server",
sanitize_server_role("member server"))
@@ -132,7 +133,9 @@ class SanitizeServerRoleTests(TestCase):
self.assertRaises(ValueError, sanitize_server_role, "foo")
def test_valid(self):
- self.assertEquals("standalone", sanitize_server_role("ROLE_STANDALONE"))
+ self.assertEquals("standalone server", sanitize_server_role("ROLE_STANDALONE"))
+ self.assertEquals("standalone server", sanitize_server_role("standalone"))
+ self.assertEquals("active directory domain controller", sanitize_server_role("domain controller"))
class DummyLogger(object):