Don't try to update ipauserobjectclasses or ipagroupobjectclasses

since they aren't being displayed anymore. They will just get blanked.

Also add some error handling in ipahelper.fix_incoming_fields()

438256
This commit is contained in:
Rob Crittenden 2008-04-02 21:15:49 -04:00
parent d567aa4441
commit c30a533de6
2 changed files with 13 additions and 9 deletions

View File

@ -16,6 +16,7 @@
#
import re
import logging
def javascript_string_escape(input):
"""Escapes the ' " and \ characters in a string so
@ -50,8 +51,11 @@ def fix_incoming_fields(fields, fieldname, multifieldname):
field, then removes the multiple field.
"""
fields[fieldname] = []
for i in range(len(fields[multifieldname])):
fields[fieldname].append(fields[multifieldname][i][fieldname])
del(fields[multifieldname])
try:
for i in range(len(fields[multifieldname])):
fields[fieldname].append(fields[multifieldname][i][fieldname])
del(fields[multifieldname])
except Exception, e:
logging.warn("fix_incoming_fields error: " + str(e))
return fields

View File

@ -163,12 +163,12 @@ class IPAPolicyController(IPAController):
if new_ipapolicy.getValues('ipadefaultprimarygroup') != kw.get('ipadefaultprimarygroup'):
policy_modified = True
new_ipapolicy.setValue('ipadefaultprimarygroup', kw.get('ipadefaultprimarygroup'))
if new_ipapolicy.getValues('ipauserobjectclasses') != kw.get('ipauserobjectclasses'):
policy_modified = True
new_ipapolicy.setValue('ipauserobjectclasses', kw.get('ipauserobjectclasses'))
if new_ipapolicy.getValues('ipagroupobjectclasses') != kw.get('ipagroupobjectclasses'):
policy_modified = True
new_ipapolicy.setValue('ipagroupobjectclasses', kw.get('ipagroupobjectclasses'))
# if new_ipapolicy.getValues('ipauserobjectclasses') != kw.get('ipauserobjectclasses'):
# policy_modified = True
# new_ipapolicy.setValue('ipauserobjectclasses', kw.get('ipauserobjectclasses'))
# if new_ipapolicy.getValues('ipagroupobjectclasses') != kw.get('ipagroupobjectclasses'):
# policy_modified = True
# new_ipapolicy.setValue('ipagroupobjectclasses', kw.get('ipagroupobjectclasses'))
if new_ipapolicy.getValues('ipadefaultemaildomain') != kw.get('ipadefaultemaildomain'):
policy_modified = True
new_ipapolicy.setValue('ipadefaultemaildomain', kw.get('ipadefaultemaildomain'))