[Libvirt-cim] [PATCH] [TEST] Fixing assoc.py and updating the Associators and AssociatorNames to work with sblim-base-providers

Kaitlin Rupert kaitlin at linux.vnet.ibm.com
Tue Sep 30 18:48:48 UTC 2008


> diff -r 0ecb3a22c361 -r 52f8b84c5bc6 suites/libvirt-cim/lib/XenKvmLib/assoc.py
> --- a/suites/libvirt-cim/lib/XenKvmLib/assoc.py	Fri Sep 26 02:44:52 2008 -0700
> +++ b/suites/libvirt-cim/lib/XenKvmLib/assoc.py	Tue Sep 30 05:06:02 2008 -0700
> @@ -42,13 +42,16 @@ def AssociatorNames(host, basetype, base
>      type = basetype.split('_')
>      if len(type) == 2:
>          basetype = type[1]
> -
> -    obj = baseobj.split('_')
> -    if len(type) == 2:
> -        baseobj = obj[1]
> +    
> +    if baseobj != 'Linux_ComputerSystem':
> +        obj = baseobj.split('_')
> +        if len(obj) == 2:
> +            baseobj = obj[1]
> +        obj = get_typed_class(virt, baseobj)
> +    else:
> +        obj = baseobj

I don't think the Linux_ComputerSystem classname should be embedded in 
the association calls.  The ConcreteComponent tests will need to support 
Linux_Processor and Linux_EthernetPort, which would mean this would need 
to be updated to include those as well.

Really, the association calls need to be updated so that they take a 
classname param instead of base and virt parameters.  That way, we build 
the classname we need in the test case itself and pass that to the 
association call.

That's a lot to change at the moment, but I think it will be good in the 
long run.  It'll allow us to support other SBLIM classnames (besides 
just Linux_ComputerSystem) and anything else we need to support in the 
future.

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




More information about the Libvirt-cim mailing list