From 2c3b654879a32601f216c27f1e6c5596f73281d4 Mon Sep 17 00:00:00 2001 From: Johannes Erdfelt Date: Tue, 1 May 2012 04:10:15 +0000 Subject: Remove hack for xenapi driver tests Various changes since the hack was introduced make removing it much easier now. Change-Id: I3237e94e034a1a1011ce4e4307ace8ea2e6432f0 --- nova/tests/xenapi/stubs.py | 4 ++++ nova/virt/xenapi/vm_utils.py | 6 +----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/nova/tests/xenapi/stubs.py b/nova/tests/xenapi/stubs.py index 8ff6b0c50..7c58fbec7 100644 --- a/nova/tests/xenapi/stubs.py +++ b/nova/tests/xenapi/stubs.py @@ -311,9 +311,13 @@ def stub_out_vm_methods(stubs): def fake_generate_ephemeral(cls, *args): pass + def fake_wait_for_device(dev): + pass + stubs.Set(vmops.VMOps, "_acquire_bootlock", fake_acquire_bootlock) stubs.Set(vmops.VMOps, "_release_bootlock", fake_release_bootlock) stubs.Set(vm_utils.VMHelper, 'generate_ephemeral', fake_generate_ephemeral) + stubs.Set(vm_utils, '_wait_for_device', fake_wait_for_device) class FakeSessionForVolumeTests(fake.SessionBase): diff --git a/nova/virt/xenapi/vm_utils.py b/nova/virt/xenapi/vm_utils.py index 64aca60ac..7f792348e 100644 --- a/nova/virt/xenapi/vm_utils.py +++ b/nova/virt/xenapi/vm_utils.py @@ -1499,11 +1499,7 @@ def vdi_attached_here(session, vdi_ref, read_only=False): if dev != orig_dev: LOG.debug(_('VBD %(vbd_ref)s plugged into wrong dev, ' 'remapping to %(dev)s') % locals()) - if dev != 'autodetect': - # NOTE(johannes): Unit tests will end up with a device called - # 'autodetect' which obviously won't exist. It's not ideal, - # but the alternatives were much messier - _wait_for_device(dev) + _wait_for_device(dev) yield dev finally: LOG.debug(_('Destroying VBD for VDI %s ... '), vdi_ref) -- cgit