From 2a21fcd073b44eb32f821fe3eb938dba7c34f6bc Mon Sep 17 00:00:00 2001 From: Vincent Untz Date: Fri, 3 Apr 2015 16:32:10 +0200 Subject: [PATCH] Add 'docker' to the list of known hypervisor types nova-docker is out of tree, but it's starting to be used by people, and being able to use a docker-specific hypervisor type can be quite useful (in mixed-hypervisor environments, for instance). Change-Id: I5a50de6bf73372f1ab999fd977aa58b33ffacfb9 --- nova/compute/hv_type.py | 2 ++ nova/tests/unit/compute/test_hvtype.py | 3 +++ 2 files changed, 5 insertions(+) diff --git a/nova/compute/hv_type.py b/nova/compute/hv_type.py index 92cb980b90ef..1435289763bc 100644 --- a/nova/compute/hv_type.py +++ b/nova/compute/hv_type.py @@ -29,6 +29,7 @@ from nova import exception # even if not currently supported by OpenStack. BAREMETAL = "baremetal" BHYVE = "bhyve" +DOCKER = "docker" FAKE = "fake" HYPERV = "hyperv" KQEMU = "kqemu" @@ -48,6 +49,7 @@ ZVM = "zvm" ALL = ( BAREMETAL, BHYVE, + DOCKER, FAKE, HYPERV, KQEMU, diff --git a/nova/tests/unit/compute/test_hvtype.py b/nova/tests/unit/compute/test_hvtype.py index 41786eb48198..88aaab5773c6 100644 --- a/nova/tests/unit/compute/test_hvtype.py +++ b/nova/tests/unit/compute/test_hvtype.py @@ -25,6 +25,9 @@ class HvTypeTest(test.NoDBTestCase): def test_valid_constant(self): self.assertTrue(hv_type.is_valid(hv_type.QEMU)) + def test_valid_docker(self): + self.assertTrue(hv_type.is_valid("docker")) + def test_valid_bogus(self): self.assertFalse(hv_type.is_valid("acmehypervisor"))