summaryrefslogtreecommitdiffstats
path: root/ipa-admintools
diff options
context:
space:
mode:
authorJohn Dennis <jdennis@redhat.com>2007-11-27 21:55:06 -0500
committerJohn Dennis <jdennis@redhat.com>2007-11-27 21:55:06 -0500
commitf73bd4e27ef6d048b47ebe5ba2b058ba704738dd (patch)
tree44498e4a4af6e1ffebe253577ae5cb7728b2d934 /ipa-admintools
parent3fb9a813399cd4948e1370b36014022e1f598816 (diff)
downloadfreeipa-f73bd4e27ef6d048b47ebe5ba2b058ba704738dd.tar.gz
freeipa-f73bd4e27ef6d048b47ebe5ba2b058ba704738dd.tar.xz
freeipa-f73bd4e27ef6d048b47ebe5ba2b058ba704738dd.zip
bug fixes
Diffstat (limited to 'ipa-admintools')
-rw-r--r--ipa-admintools/ipa-addradiusclient2
-rw-r--r--ipa-admintools/ipa-addradiusprofile2
-rw-r--r--ipa-admintools/ipa-radiusclientmod4
-rw-r--r--ipa-admintools/ipa-radiusprofilemod17
4 files changed, 11 insertions, 14 deletions
diff --git a/ipa-admintools/ipa-addradiusclient b/ipa-admintools/ipa-addradiusclient
index 604738537..1db571a71 100644
--- a/ipa-admintools/ipa-addradiusclient
+++ b/ipa-admintools/ipa-addradiusclient
@@ -115,7 +115,7 @@ def main():
if options.interactive:
# Prompt first for mandatory attributes which have not been previously specified
prompted_mandatory_attrs = []
- existing_attrs = pairs.keys():
+ existing_attrs = pairs.keys()
for attr in mandatory_radius_attrs:
if not attr in existing_attrs:
prompted_mandatory_attrs.append(attr)
diff --git a/ipa-admintools/ipa-addradiusprofile b/ipa-admintools/ipa-addradiusprofile
index 0872437f4..519bf4952 100644
--- a/ipa-admintools/ipa-addradiusprofile
+++ b/ipa-admintools/ipa-addradiusprofile
@@ -106,7 +106,7 @@ def main():
if options.interactive:
# Prompt first for mandatory attributes which have not been previously specified
prompted_mandatory_attrs = []
- existing_attrs = pairs.keys():
+ existing_attrs = pairs.keys()
for attr in mandatory_radius_attrs:
if not attr in existing_attrs:
prompted_mandatory_attrs.append(attr)
diff --git a/ipa-admintools/ipa-radiusclientmod b/ipa-admintools/ipa-radiusclientmod
index 19f3ed148..9e973b121 100644
--- a/ipa-admintools/ipa-radiusclientmod
+++ b/ipa-admintools/ipa-radiusclientmod
@@ -179,7 +179,9 @@ def main():
# Populate the pair list with pre-existing values
for attr in radius_attrs:
- pairs[attr] = radius_entity.getValues(radius_attr_to_ldap_attr[attr])
+ value = radius_entity.getValues(radius_attr_to_ldap_attr[attr])
+ if value is None: continue
+ pairs[attr] = value
# Get pairs from a file or stdin
if options.data_file:
diff --git a/ipa-admintools/ipa-radiusprofilemod b/ipa-admintools/ipa-radiusprofilemod
index 7a064d5ae..405abcfcc 100644
--- a/ipa-admintools/ipa-radiusprofilemod
+++ b/ipa-admintools/ipa-radiusprofilemod
@@ -115,9 +115,6 @@ def main():
print "ERROR, could not read attrs (%s)" % (e)
# Get attrs specified on the command line as a named argument
- if options.secret is not None: attrs.add('Secret')
- if options.name is not None: attrs.add('Name')
- if options.nastype is not None: attrs.add('NAS-Type')
if options.desc is not None: attrs.add('Description')
# Get attrs specified on the command line as a attr argument
@@ -172,11 +169,13 @@ def main():
else:
pairs = {}
- pairs[distinguished_attr] = ip_addr
+ pairs[distinguished_attr] = uid
# Populate the pair list with pre-existing values
for attr in radius_attrs:
- pairs[attr] = radius_entity.getValues(radius_attr_to_ldap_attr[attr])
+ value = radius_entity.getValues(radius_attr_to_ldap_attr[attr])
+ if value is None: continue
+ pairs[attr] = value
# Get pairs from a file or stdin
if options.data_file:
@@ -187,10 +186,6 @@ def main():
print "ERROR, could not read pairs (%s)" % (e)
# Get pairs specified on the command line as a named argument
- if options.ip_addr is not None: pairs[distinguished_attr] = options.ip_addr
- if options.secret is not None: pairs['Secret'] = options.secret
- if options.name is not None: pairs['Name'] = options.name
- if options.nastype is not None: pairs['NAS-Type'] = options.nastype
if options.desc is not None: pairs['Description'] = options.desc
# Get pairs specified on the command line as a pair argument
@@ -213,9 +208,9 @@ def main():
# Data collection done, assure mandatory data has been specified
- if pairs.has_key(distinguished_attr) and pairs[distinguished_attr] != ip_addr:
+ if pairs.has_key(distinguished_attr) and pairs[distinguished_attr] != uid:
print "ERROR, %s specified on command line (%s) does not match value found in pairs (%s)" % \
- (distinguished_attr, ip_addr, pairs[distinguished_attr])
+ (distinguished_attr, uid, pairs[distinguished_attr])
return 1
# Make sure each attribute is a member of the set of valid attributes