summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2012-05-01 18:47:54 +0000
committerGerrit Code Review <review@openstack.org>2012-05-01 18:47:54 +0000
commit7b664b14f02b8b0c7008e294ea6309d6afa8aed7 (patch)
tree69b83082ba50fa6993256904788b3ccd3467edcd
parenta4ecf32772feea52b89c7bca3d9299b46e02ac41 (diff)
parent2c3b654879a32601f216c27f1e6c5596f73281d4 (diff)
Merge "Remove hack for xenapi driver tests"
-rw-r--r--nova/tests/xenapi/stubs.py4
-rw-r--r--nova/virt/xenapi/vm_utils.py6
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 3002fce5a..9c478afab 100644
--- a/nova/virt/xenapi/vm_utils.py
+++ b/nova/virt/xenapi/vm_utils.py
@@ -1500,11 +1500,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)