From 4d16326bb97bdc2f1f4c06817eaea1e988b45b64 Mon Sep 17 00:00:00 2001 From: Hongbin Lu Date: Fri, 23 Dec 2016 15:46:59 -0600 Subject: [PATCH] Rename virt driver from 'docker' to 'zun' The rationals are as following: * Make it clear that the in-tree virt driver is not the same as the nova-docker driver * Justify that Zun is going to support additional runtime * Avoid name collision with nova-docker on packaging. Change-Id: I08f9cc0100837f62c57e2e77cd7f6cd727b91b69 Closes-Bug: #1652387 --- devstack/lib/nova | 2 +- devstack/override-defaults | 2 +- nova/virt/{docker => zun}/__init__.py | 2 +- nova/virt/{docker => zun}/client.py | 0 nova/virt/{docker => zun}/driver.py | 9 +++++---- nova/virt/{docker => zun}/hostinfo.py | 0 nova/virt/{docker => zun}/network.py | 0 nova/virt/{docker => zun}/opencontrail.py | 0 nova/virt/{docker => zun}/vifs.py | 2 +- 9 files changed, 9 insertions(+), 8 deletions(-) rename nova/virt/{docker => zun}/__init__.py (95%) rename nova/virt/{docker => zun}/client.py (100%) rename nova/virt/{docker => zun}/driver.py (99%) rename nova/virt/{docker => zun}/hostinfo.py (100%) rename nova/virt/{docker => zun}/network.py (100%) rename nova/virt/{docker => zun}/opencontrail.py (100%) rename nova/virt/{docker => zun}/vifs.py (99%) diff --git a/devstack/lib/nova b/devstack/lib/nova index 7b937fe3d..7350a7632 100644 --- a/devstack/lib/nova +++ b/devstack/lib/nova @@ -27,7 +27,7 @@ NOVA_CONF=${NOVA_CONF:-NOVA_CONF_DIR/nova.conf} # configure_nova_docker - Set config files, create data dirs, etc function configure_nova_docker { - iniset $NOVA_CONF DEFAULT compute_driver docker.DockerDriver + iniset $NOVA_CONF DEFAULT compute_driver zun.DockerDriver # CentOS/RedHat distros don't start the services just after the package # is installed if it is not explicitily set. So the script fails on diff --git a/devstack/override-defaults b/devstack/override-defaults index bd47dcde4..5cc652f90 100644 --- a/devstack/override-defaults +++ b/devstack/override-defaults @@ -3,5 +3,5 @@ ZUN_DRIVER=${ZUN_DRIVER:-docker} if [[ ${ZUN_DRIVER} == "nova-docker" ]]; then - export VIRT_DRIVER=docker + export VIRT_DRIVER=zun fi diff --git a/nova/virt/docker/__init__.py b/nova/virt/zun/__init__.py similarity index 95% rename from nova/virt/docker/__init__.py rename to nova/virt/zun/__init__.py index 93544a795..d99fc423e 100644 --- a/nova/virt/docker/__init__.py +++ b/nova/virt/zun/__init__.py @@ -17,6 +17,6 @@ :mod:`docker` -- Nova support for Docker Hypervisor to run Linux containers =========================================================================== """ -from nova.virt.docker import driver +from nova.virt.zun import driver DockerDriver = driver.DockerDriver diff --git a/nova/virt/docker/client.py b/nova/virt/zun/client.py similarity index 100% rename from nova/virt/docker/client.py rename to nova/virt/zun/client.py diff --git a/nova/virt/docker/driver.py b/nova/virt/zun/driver.py similarity index 99% rename from nova/virt/docker/driver.py rename to nova/virt/zun/driver.py index ceeaaf8ea..75609a90a 100644 --- a/nova/virt/docker/driver.py +++ b/nova/virt/zun/driver.py @@ -43,14 +43,15 @@ from nova.i18n import _LW from nova import objects from nova.objects import fields from nova import utils -from nova.virt.docker import client as docker_client -from nova.virt.docker import hostinfo -from nova.virt.docker import network from nova.virt import driver from nova.virt import firewall from nova.virt import hardware from nova.virt import hostutils from nova.virt import images +from nova.virt.zun import client as docker_client +from nova.virt.zun import hostinfo +from nova.virt.zun import network + CONF = cfg.CONF CONF.import_opt('instances_path', 'nova.compute.manager') @@ -76,7 +77,7 @@ docker_opts = [ help='Location of TLS private key file for ' 'securing docker api requests (tlskey).'), cfg.StrOpt('vif_driver', - default='nova.virt.docker.vifs.DockerGenericVIFDriver'), + default='nova.virt.zun.vifs.DockerGenericVIFDriver'), cfg.StrOpt('snapshots_directory', default='$instances_path/snapshots', help='Location where docker driver will temporarily store ' diff --git a/nova/virt/docker/hostinfo.py b/nova/virt/zun/hostinfo.py similarity index 100% rename from nova/virt/docker/hostinfo.py rename to nova/virt/zun/hostinfo.py diff --git a/nova/virt/docker/network.py b/nova/virt/zun/network.py similarity index 100% rename from nova/virt/docker/network.py rename to nova/virt/zun/network.py diff --git a/nova/virt/docker/opencontrail.py b/nova/virt/zun/opencontrail.py similarity index 100% rename from nova/virt/docker/opencontrail.py rename to nova/virt/zun/opencontrail.py diff --git a/nova/virt/docker/vifs.py b/nova/virt/zun/vifs.py similarity index 99% rename from nova/virt/docker/vifs.py rename to nova/virt/zun/vifs.py index 218aa4125..33da8c86e 100644 --- a/nova/virt/docker/vifs.py +++ b/nova/virt/zun/vifs.py @@ -28,7 +28,7 @@ from nova.network import manager from nova.network import model as network_model from nova.network import os_vif_util from nova import utils -from nova.virt.docker import network +from nova.virt.zun import network from oslo_config import cfg # We need config opts from manager, but pep8 complains, this silences it.