[Libvirt-cim] [PATCH] [TEST] Fix HostedService-02_reverse.py with sblim base provider installed

Kaitlin Rupert kaitlin at linux.vnet.ibm.com
Fri Sep 26 21:53:39 UTC 2008


>      options = main.options
> -    keys = ['Name', 'CreationClassName']
> -    try:
> -        host_sys = enumclass.enumerate(options.ip, 'HostSystem', keys, options.virt)[0]
> -    except Exception:
> -        logger.error(Globals.CIM_ERROR_ENUMERATE % host_sys.CreationClassName)
> -        return FAIL
> +    ret, linux_cs = check_sblim(options.ip, options.virt)
> +    if ret == PASS:
> +        host_sys = linux_cs
> +    else:
> +        keys = ['Name', 'CreationClassName']
> +        try:
> +            host_sys = enumclass.enumerate(options.ip, 'HostSystem', keys, options.virt)[0]
> +        except Exception:
> +            logger.error(Globals.CIM_ERROR_ENUMERATE % host_sys.CreationClassName)
> +            return FAIL

With Deepti's patch, you can use get_host_info() instead.

>      servicelist = {"ResourcePoolConfigurationService" : "RPCS", 
>                     "VirtualSystemManagementService" : "Management Service",
>                     "VirtualSystemMigrationService" : "MigrationService"}
> @@ -67,7 +72,8 @@ def main():
>          ccn = assoc_host[0].keybindings['CreationClassName']
>          name = assoc_host[0].keybindings['Name']
>          
> -        if ccn != get_typed_class(options.virt, "HostSystem"):
> +        if ccn != get_typed_class(options.virt, "HostSystem")\
> +          and ccn != 'Linux_ComputerSystem':

Instead of using HostSystem and Linux_ComputerSystem here, you can use 
the host_sys CreationClassName.

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




More information about the Libvirt-cim mailing list