add parse_items(), read_items_file()

move read_pairs_file() to ipautil
This commit is contained in:
John Dennis
2007-11-26 23:11:49 -05:00
parent c5a43a0168
commit 78b5987101
6 changed files with 37 additions and 20 deletions

View File

@@ -59,8 +59,6 @@ __all__ = [
'radius_profile_ldap_attr_to_radius_attr',
'radius_profile_attr_to_ldap_attr',
'read_pairs_file',
'get_secret',
'validate_ip_addr',
'validate_secret',
@@ -240,19 +238,6 @@ def radius_profile_dn(uid, container, suffix):
#------------------------------------------------------------------------------
comment_re = re.compile('#.*$', re.MULTILINE)
def read_pairs_file(filename):
if filename == '-':
fd = sys.stdin
else:
fd = open(filename)
data = fd.read()
data = comment_re.sub('', data) # kill comments
pairs = ipautil.parse_key_value_pairs(data)
if fd != sys.stdin: fd.close()
return pairs
def get_ldap_attr_translations():
comment_re = re.compile('#.*$')
radius_attr_to_ldap_attr = {}