[Libvirt-cim] [PATCH 1 of 2] [TEST] Modified pool.py to support RPCS CreateResourceInPool

Kaitlin Rupert kaitlin at linux.vnet.ibm.com
Tue Sep 8 22:08:19 UTC 2009


> +def get_stovol_rasd_from_sdc(virt, server, dp_inst_id):
> +    rasd = None
> +    ac_cn = get_typed_class(virt, "AllocationCapabilities")
> +    an_cn = get_typed_class(virt, "SettingsDefineCapabilities")
> +    key_list = {"InstanceID" : dp_inst_id} 
> +    
> +    try:
> +        inst = GetInstance(server, ac_cn, key_list)

What if inst is None - should return an error here.

> +        rasd = Associators(server, an_cn, ac_cn, InstanceID=inst.InstanceID)

Should also check to make sure rasd is of some length - otherwise, 
return an error.

> +    except Exception, detail:
> +        logger.error("Exception: %s", detail)
> +        return FAIL, None
> +
> +    return PASS, rasd
> +


-- 
Kaitlin Rupert
IBM Linux Technology Center
kaitlin at linux.vnet.ibm.com




More information about the Libvirt-cim mailing list