+
+ for item in data:
+ if item['InstanceID'] == rasd[cn]:
+ logger.info("%s InstanceID match - expect %s, got %s" \
+ % (cn, rasd[cn], item['InstanceID']))
+ return PASS
+ else:
+ logger.error("RASD instance with InstanceID %s not found" %
rasd[cn])
+ return FAIL
+
You don't want an else statement in the for loop. If the first element
in data doesn't match, you'll return an error from the function.
Instead, you'll want return a failure after the loop is complete:
for item in data:
if item['InstanceID'] == rasd[cn]:
logger.info("%s InstanceID match - expect %s, got %s" \
% (cn, rasd[cn], item['InstanceID']))
return PASS
logger.error("RASD instance with InstanceID %s not found" % rasd[cn])
return FAIL
--
Kaitlin Rupert
IBM Linux Technology Center
kaitlin(a)linux.vnet.ibm.com