From 6db8f730e8d8c572051ab9d043e2ec10a086d949 Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Wed, 8 Oct 2014 16:04:18 +0100 Subject: [PATCH] hyperv: use standard architecture constants for CPU model When reporting the 'cpu_info' field in the get_available_resource method, one of the fields is the architecture. The hyperv driver has mistakenly used printable architecture names, as opposed to the canonical architecture names. Switch to use the compute.arch constants. Although this changes the data reported by hyperv, it should not have a functional impact since only the libvirt driver is relying on the precise format of this data. For hyperv it is merely informational. Cleanup before Blueprint: resource-objects Change-Id: I6bfbfc829f45dee49e1f2eeaa0490068da26ccb2 --- nova/virt/hyperv/constants.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/nova/virt/hyperv/constants.py b/nova/virt/hyperv/constants.py index 6d8e72461693..517f30376e4e 100644 --- a/nova/virt/hyperv/constants.py +++ b/nova/virt/hyperv/constants.py @@ -17,6 +17,7 @@ Constants used in ops classes """ +from nova.compute import arch from nova.compute import power_state HYPERV_VM_STATE_ENABLED = 2 @@ -35,13 +36,13 @@ HYPERV_POWER_STATE = { } WMI_WIN32_PROCESSOR_ARCHITECTURE = { - 0: 'x86', - 1: 'MIPS', - 2: 'Alpha', - 3: 'PowerPC', - 5: 'ARM', - 6: 'Itanium-based systems', - 9: 'x64', + 0: arch.I686, + 1: arch.MIPS, + 2: arch.ALPHA, + 3: arch.PPC, + 5: arch.ARMV7, + 6: arch.IA64, + 9: arch.X86_64, } PROCESSOR_FEATURE = {