DK> +def check_len(an, assoc_list_info, qcn, crit='eq', exp_len=0):
DK> + if crit == 'ne':
DK> + expr = 'len(assoc_list_info) != exp_len'
DK> + elif crit == 'eq':
DK> + expr = 'len(assoc_list_info) == exp_len'
DK> + elif crit == 'lt':
DK> + expr = 'len(assoc_list_info) < exp_len'
DK> + elif crit == 'gt':
DK> + expr = 'len(assoc_list_info) > exp_len'
DK> + elif crit == 'le':
DK> + expr = 'len(assoc_list_info) <= exp_len'
DK> + else:
DK> + expr = 'len(assoc_list_info) <= exp_len'
DK> + if eval(expr) :
DK> + logger.error("%s returned %i %s objects, as compared with %i" %
(an, len(assoc_list_info), qcn, exp_len))
DK> + return FAIL
DK> + return PASS
DK> +
Sorry, but this will not go into the tree. Ever.
--
Dan Smith
IBM Linux Technology Center
Open Hypervisor Team
email: danms(a)us.ibm.com