mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
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
This commit is contained in:
parent
39076c5a3f
commit
bf38a5df5b
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user