> - try:
> - status = test_rasd(options, temp, test_size)
> - except Exception, e:
> - logger.error("Failed to test RASD: %s" % e)
> + cn = get_typed_class(options.virt,
> 'DiskResourceAllocationSettingData') + rasds =
> enumclass.EnumInstances(options.ip, cn, ret_cim_inst=True)
>
>
Instead of Enumerating the DiskRASD we can use GetInstance() on the domain.
Like that we would avoid the for rasd in rasds loop.
Instead we can verify the address directly if it is returned and then
call the check_rasd_size() directly.
Any specific reason to use EnumInstances ?
I'd like to leave EnumInstances() here. From what I've seen,
EnumerateInstances() is used by CIM clients more often than
GetInstance() is.
For GetInstance(), you need to have the reference object beforehand.
Since we don't have one, in this case, we build one - but that's because
we know how the InstanceID is formatted.
From what I understand, the CIM client shouldn't need to build
reference objects. It should only use the reference objects returned by
the CIMOM - either by a EnumerateInstanceNames() or an AssociatorNames()
call.
I think it's good for the tests to have a mix of both, although my
preference is to use EnumInstances() because it's less contrived.
--
Kaitlin Rupert
IBM Linux Technology Center
kaitlin(a)linux.vnet.ibm.com