Merge "Clean up the remaining logic for Windows OS Support"
This commit is contained in:
@@ -44,10 +44,6 @@ def _monkey_patch():
|
||||
if debugger.enabled():
|
||||
# turn off thread patching to enable the remote debugger
|
||||
eventlet.monkey_patch(thread=False)
|
||||
elif os.name == 'nt':
|
||||
# for nova-compute running on Windows(Hyper-v)
|
||||
# pipes don't support non-blocking I/O
|
||||
eventlet.monkey_patch(os=False)
|
||||
else:
|
||||
eventlet.monkey_patch()
|
||||
|
||||
|
||||
8
nova/tests/fixtures/nova.py
vendored
8
nova/tests/fixtures/nova.py
vendored
@@ -1088,13 +1088,7 @@ class PoisonFunctions(fixtures.Fixture):
|
||||
def setUp(self):
|
||||
super(PoisonFunctions, self).setUp()
|
||||
|
||||
try:
|
||||
self._poison_libvirt_driver()
|
||||
except ImportError:
|
||||
# The libvirt driver uses modules that are not available
|
||||
# on Windows.
|
||||
if os.name != 'nt':
|
||||
raise
|
||||
self._poison_libvirt_driver()
|
||||
|
||||
def _poison_libvirt_driver(self):
|
||||
# The nova libvirt driver starts an event thread which only
|
||||
|
||||
@@ -13,11 +13,9 @@
|
||||
# under the License.
|
||||
|
||||
from collections import OrderedDict
|
||||
import os
|
||||
|
||||
import fixtures
|
||||
|
||||
from nova import exception
|
||||
from nova import test
|
||||
from nova.tests.unit.virt.disk.vfs import fakeguestfs
|
||||
from nova.virt.disk import api as diskapi
|
||||
@@ -47,19 +45,6 @@ class VirtDiskTest(test.NoDBTestCase):
|
||||
key="mysshkey",
|
||||
mandatory=('key',)))
|
||||
|
||||
os_name = os.name
|
||||
os.name = 'nt' # Cause password injection to fail
|
||||
self.assertRaises(exception.NovaException,
|
||||
diskapi.inject_data,
|
||||
imgmodel.LocalFileImage("/some/file",
|
||||
imgmodel.FORMAT_RAW),
|
||||
admin_password="p",
|
||||
mandatory=('admin_password',))
|
||||
self.assertFalse(diskapi.inject_data(
|
||||
imgmodel.LocalFileImage("/some/file", imgmodel.FORMAT_RAW),
|
||||
admin_password="p"))
|
||||
os.name = os_name
|
||||
|
||||
self.assertFalse(diskapi.inject_data(
|
||||
imgmodel.LocalFileImage("/some/fail/file", imgmodel.FORMAT_RAW),
|
||||
key="mysshkey"))
|
||||
|
||||
@@ -23,6 +23,7 @@ Includes injection of SSH PGP keys into authorized_keys file.
|
||||
|
||||
"""
|
||||
|
||||
import crypt
|
||||
import os
|
||||
import random
|
||||
import tempfile
|
||||
@@ -41,9 +42,6 @@ from nova.virt.disk.vfs import api as vfs
|
||||
from nova.virt.image import model as imgmodel
|
||||
from nova.virt import images
|
||||
|
||||
if os.name != 'nt':
|
||||
import crypt
|
||||
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
@@ -621,9 +619,6 @@ def _set_passwd(username, admin_passwd, passwd_data, shadow_data):
|
||||
:raises: exception.NovaException(), IOError()
|
||||
|
||||
"""
|
||||
if os.name == 'nt':
|
||||
raise exception.NovaException(_('Not implemented on Windows'))
|
||||
|
||||
# encryption algo - id pairs for crypt()
|
||||
algos = {'SHA-512': '$6$', 'SHA-256': '$5$', 'MD5': '$1$', 'DES': ''}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user