svn commit: samba r26375 - in branches/SAMBA_4_0: . source/scripting/python/samba

jelmer at samba.org jelmer at samba.org
Mon Dec 10 10:29:46 GMT 2007


Author: jelmer
Date: 2007-12-10 10:29:45 +0000 (Mon, 10 Dec 2007)
New Revision: 26375

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=26375

Log:
Move provision-independent utility function to main samba python module.
Modified:
   branches/SAMBA_4_0/
   branches/SAMBA_4_0/source/scripting/python/samba/__init__.py
   branches/SAMBA_4_0/source/scripting/python/samba/provision.py


Changeset:

Property changes on: branches/SAMBA_4_0
___________________________________________________________________
Name: bzr:revision-info
...skipped...
Name: bzr:revision-id:v3-trunk0
...skipped...

Modified: branches/SAMBA_4_0/source/scripting/python/samba/__init__.py
===================================================================
--- branches/SAMBA_4_0/source/scripting/python/samba/__init__.py	2007-12-10 10:29:42 UTC (rev 26374)
+++ branches/SAMBA_4_0/source/scripting/python/samba/__init__.py	2007-12-10 10:29:45 UTC (rev 26375)
@@ -55,3 +55,12 @@
 
     return text
 
+
+def valid_netbios_name(name):
+    """Check whether a name is valid as a NetBIOS name. """
+    # FIXME: There are probably more constraints here. 
+    # crh has a paragraph on this in his book (1.4.1.1)
+    if len(name) > 13:
+        return False
+    return True
+

Modified: branches/SAMBA_4_0/source/scripting/python/samba/provision.py
===================================================================
--- branches/SAMBA_4_0/source/scripting/python/samba/provision.py	2007-12-10 10:29:42 UTC (rev 26374)
+++ branches/SAMBA_4_0/source/scripting/python/samba/provision.py	2007-12-10 10:29:45 UTC (rev 26375)
@@ -14,7 +14,7 @@
 from socket import gethostname, gethostbyname
 import param
 import registry
-from samba import Ldb, substitute_var
+from samba import Ldb, substitute_var, valid_netbios_name
 from ldb import Dn, SCOPE_SUBTREE, SCOPE_ONELEVEL, SCOPE_BASE, LdbError, \
         LDB_ERR_NO_SUCH_OBJECT, timestring
 
@@ -191,14 +191,17 @@
 """ % (res[0].dn, unixname)
     ldb.modify(ldb.parse_ldif(mod).next()[1])
 
+
 def hostip():
     """return first host IP."""
     return gethostbyname(hostname())
 
+
 def hostname():
     """return first part of hostname."""
     return gethostname().split(".")[0]
 
+
 def ldb_delete(ldb):
     """Delete a LDB file.
 
@@ -805,15 +808,6 @@
     ldb.transaction_commit()
 
 
-def valid_netbios_name(name):
-    """Check whether a name is valid as a NetBIOS name. """
-    # FIXME: There are probably more constraints here. 
-    # crh has a paragraph on this in his book (1.4.1.1)
-    if len(name) > 13:
-        return False
-    return True
-
-
 def join_domain(domain, netbios_name, join_type, creds, message):
     ctx = NetContext(creds)
     joindom = object()



More information about the samba-cvs mailing list