From 88a383571d28eca2fb2f81f20f78f4d6e3bf9281 Mon Sep 17 00:00:00 2001 From: Vasyl Saienko Date: Thu, 26 Mar 2015 14:26:56 +0200 Subject: [PATCH] add ironic hypervisor type added missed hypervisor type: ironic Closes-Bug:1436750 Change-Id: Ie66973f14c405c9ffa28a0fc6223d11d18611e20 --- nova/compute/hv_type.py | 2 ++ nova/scheduler/ironic_host_manager.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/nova/compute/hv_type.py b/nova/compute/hv_type.py index 92cb980b90ef..22e32b275132 100644 --- a/nova/compute/hv_type.py +++ b/nova/compute/hv_type.py @@ -31,6 +31,7 @@ BAREMETAL = "baremetal" BHYVE = "bhyve" FAKE = "fake" HYPERV = "hyperv" +IRONIC = "ironic" KQEMU = "kqemu" KVM = "kvm" LXC = "lxc" @@ -50,6 +51,7 @@ ALL = ( BHYVE, FAKE, HYPERV, + IRONIC, KQEMU, KVM, LXC, diff --git a/nova/scheduler/ironic_host_manager.py b/nova/scheduler/ironic_host_manager.py index 8c53115b3279..73e95b1a72d9 100644 --- a/nova/scheduler/ironic_host_manager.py +++ b/nova/scheduler/ironic_host_manager.py @@ -26,6 +26,7 @@ from oslo_config import cfg from oslo_log import log as logging from oslo_utils import timeutils +from nova.compute import hv_type from nova.scheduler import host_manager host_manager_opts = [ @@ -107,7 +108,7 @@ class IronicHostManager(host_manager.HostManager): def host_state_cls(self, host, node, **kwargs): """Factory function/property to create a new HostState.""" compute = kwargs.get('compute') - if compute and compute.get('hypervisor_type') == 'ironic': + if compute and compute.get('hypervisor_type') == hv_type.IRONIC: return IronicNodeState(host, node, **kwargs) else: return host_manager.HostState(host, node, **kwargs)