/* 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"},
netbiosname = determine_netbios_name(hostname)
if serverrole is None:
- serverrole = "standalone"
+ serverrole = "standalone server"
if sid_generator is None:
sid_generator = "internal"
_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",
"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",
}
: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]
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
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"))
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):