summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/param/param_enums.c1
-rw-r--r--source4/scripting/python/samba/provision/__init__.py11
-rw-r--r--source4/scripting/python/samba/tests/provision.py7
3 files changed, 12 insertions, 7 deletions
diff --git a/lib/param/param_enums.c b/lib/param/param_enums.c
index 08d60101d1..afcf2f0d04 100644
--- a/lib/param/param_enums.c
+++ b/lib/param/param_enums.c
@@ -75,6 +75,7 @@ static const struct enum_list enum_csc_policy[] = {
/* Server role options */
static const struct enum_list enum_server_role[] = {
{ROLE_AUTO, "auto"},
+ {ROLE_STANDALONE, "standalone server"},
{ROLE_STANDALONE, "standalone"},
{ROLE_DOMAIN_MEMBER, "member server"},
{ROLE_DOMAIN_MEMBER, "member"},
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):