summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2012-05-27 14:17:52 +0200
committerJelmer Vernooij <jelmer@samba.org>2012-05-27 16:13:34 +0200
commitbf38a5df5b69d41e4fa5fff7cb4447a5155058ce (patch)
treec0cc48a12cdb22907ebf4eb58abe2e7f1231c34f
parent39076c5a3f8aebde8709eb9a2367b76789142aed (diff)
downloadsamba-bf38a5df5b69d41e4fa5fff7cb4447a5155058ce.tar.gz
samba-bf38a5df5b69d41e4fa5fff7cb4447a5155058ce.tar.bz2
samba-bf38a5df5b69d41e4fa5fff7cb4447a5155058ce.zip
Avoid all(), as it's not available in Python 2.4.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org> Autobuild-Date: Sun May 27 16:13:34 CEST 2012 on sn-devel-104
-rw-r--r--source4/scripting/python/samba/__init__.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/source4/scripting/python/samba/__init__.py b/source4/scripting/python/samba/__init__.py
index 6ffd2a308c..23c6ed77d7 100644
--- a/source4/scripting/python/samba/__init__.py
+++ b/source4/scripting/python/samba/__init__.py
@@ -302,12 +302,16 @@ MAX_NETBIOS_NAME_LEN = 15
def is_valid_netbios_char(c):
return (c.isalnum() or c in " !#$%&'()-.@^_{}~")
+
def valid_netbios_name(name):
"""Check whether a name is valid as a NetBIOS name. """
# See crh's book (1.4.1.1)
if len(name) > MAX_NETBIOS_NAME_LEN:
return False
- return all([is_valid_netbios_char(x) for x in name])
+ for x in name:
+ if not is_valid_netbios_char(x):
+ return False
+ return True
def import_bundled_package(modulename, location):