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@linux.vnet.ibm.com