From c419ebe0cf667ba1dfa5d9c0c868fdf597de4dab Mon Sep 17 00:00:00 2001 From: Hongbin Lu Date: Fri, 2 Dec 2016 10:27:44 -0600 Subject: [PATCH] Remove windows support from Nova driver The windows support was added to nova-docker in before [1]. However, it seems the Zun team doesn't have an maintainer of codes in this part, so let's remove it for now. [1] https://review.openstack.org/#/c/219657/ Change-Id: I7f7de5ea920b69e6a79d624ae7e0e0f79e69853c --- nova/virt/docker/driver.py | 3 --- nova/virt/docker/network.py | 5 ----- nova/virt/docker/vifs.py | 10 ---------- nova/virt/hostutils.py | 17 ++--------------- 4 files changed, 2 insertions(+), 33 deletions(-) diff --git a/nova/virt/docker/driver.py b/nova/virt/docker/driver.py index 86264fd51..92e996479 100644 --- a/nova/virt/docker/driver.py +++ b/nova/virt/docker/driver.py @@ -212,9 +212,6 @@ class DockerDriver(driver.ComputeDriver): if not network_info: return - if os.name == 'nt': - return - container_id = self._get_container_id(instance) if not container_id: raise exception.InstanceNotFound(instance_id=instance['name']) diff --git a/nova/virt/docker/network.py b/nova/virt/docker/network.py index 8e040b3dd..6f77435dd 100644 --- a/nova/virt/docker/network.py +++ b/nova/virt/docker/network.py @@ -13,8 +13,6 @@ # License for the specific language governing permissions and limitations # under the License. -import os - from oslo_concurrency import processutils from oslo_log import log @@ -27,9 +25,6 @@ LOG = log.getLogger(__name__) def teardown_network(container_id): - if os.name == 'nt': - return - try: output, err = utils.execute('ip', '-o', 'netns', 'list') for line in output.split('\n'): diff --git a/nova/virt/docker/vifs.py b/nova/virt/docker/vifs.py index 02bd49e81..33a666929 100644 --- a/nova/virt/docker/vifs.py +++ b/nova/virt/docker/vifs.py @@ -65,15 +65,10 @@ class DockerGenericVIFDriver(object): self.plug_midonet(instance, vif) elif vif_type == network_model.VIF_TYPE_IOVISOR: self.plug_iovisor(instance, vif) - elif vif_type == 'hyperv': - self.plug_windows(instance, vif) else: raise exception.NovaException( _("Unexpected vif_type=%s") % vif_type) - def plug_windows(self, instance, vif): - pass - def plug_iovisor(self, instance, vif): """Plug docker vif into IOvisor @@ -337,15 +332,10 @@ class DockerGenericVIFDriver(object): self.unplug_midonet(instance, vif) elif vif_type == network_model.VIF_TYPE_IOVISOR: self.unplug_iovisor(instance, vif) - elif vif_type == 'hyperv': - self.unplug_windows(instance, vif) else: raise exception.NovaException( _("Unexpected vif_type=%s") % vif_type) - def unplug_windows(self, instance, vif): - pass - def unplug_iovisor(self, instance, vif): """Unplug vif from IOvisor diff --git a/nova/virt/hostutils.py b/nova/virt/hostutils.py index fb3b4a370..a78b6286a 100644 --- a/nova/virt/hostutils.py +++ b/nova/virt/hostutils.py @@ -13,23 +13,10 @@ # License for the specific language governing permissions and limitations # under the License. - -import ctypes -import datetime -import os -import time - from nova import utils def sys_uptime(): """Returns the host uptime.""" - - if os.name == 'nt': - tick_count64 = ctypes.windll.kernel32.GetTickCount64() - return ("%s up %s, 0 users, load average: 0, 0, 0" % - (str(time.strftime("%H:%M:%S")), - str(datetime.timedelta(milliseconds=long(tick_count64))))) - else: - out, err = utils.execute('env', 'LANG=C', 'uptime') - return out + out, err = utils.execute('env', 'LANG=C', 'uptime') + return out