[abac] correct string management in comparison operand

This commit is contained in:
Mikaël Ates 2011-08-06 09:03:48 +02:00
parent 3d10dd6a87
commit ffc54bee21
1 changed files with 6 additions and 1 deletions

View File

@ -665,7 +665,12 @@ def handle_operand(predicate, p_id, name, d):
except:
raise Exception('Unable to create data of %s of predicate %s' % (name, str(p_id)))
for value in predicate[name + '_defined']['values_selected']:
if d.attribute_type == ACS_XACML_DATATYPE_INTEGER:
if d.attribute_type == ACS_XACML_DATATYPE_STRING:
try:
StringM(data=data, value=value).save()
except Exception, err:
raise Exception('Unable to set string %s i.e. %s of %s of predicate %s, err %s' % (value, d.attribute_type, name, str(p_id), str(err)))
elif d.attribute_type == ACS_XACML_DATATYPE_INTEGER:
try:
v = int(value)
IntegerM(data=data, value=v).save()