mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
add parse_items(), read_items_file()
move read_pairs_file() to ipautil
This commit is contained in:
@@ -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 = {}
|
||||
|
||||
Reference in New Issue
Block a user