]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
provision: Reuse determine_netbios_name.
authorJelmer Vernooij <jelmer@samba.org>
Sun, 26 Feb 2012 19:40:26 +0000 (20:40 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Sun, 26 Feb 2012 19:52:05 +0000 (20:52 +0100)
source4/scripting/python/samba/provision/__init__.py

index f28fe5b4f9542f928382cb06a5b9d7be45138f4e..e627c86a50c1024dfeb45bd91919b0d3ec24fce4 100644 (file)
@@ -599,14 +599,7 @@ def make_smbconf(smbconf, hostname, domain, realm, serverrole,
     assert smbconf is not None
     if hostname is None:
         hostname = socket.gethostname().split(".")[0]
-        netbiosname = hostname.upper()
-        # remove forbidden chars
-        newnbname = ""
-        for x in netbiosname:
-            if x.isalnum() or x in VALID_NETBIOS_CHARS:
-                newnbname = "%s%c" % (newnbname, x)
-        #force the length to be <16
-        netbiosname = newnbname[0:15]
+        netbiosname = determine_netbios_name(hostname)
     else:
         netbiosname = hostname.upper()