Merge "Remove unused _get_target code from xenapi"
This commit is contained in:
@@ -102,7 +102,6 @@ class XenAPIVolumeTestCase(test.TestCase):
|
|||||||
firewall_driver='nova.virt.xenapi.firewall.'
|
firewall_driver='nova.virt.xenapi.firewall.'
|
||||||
'Dom0IptablesFirewallDriver')
|
'Dom0IptablesFirewallDriver')
|
||||||
db_fakes.stub_out_db_instance_api(self.stubs)
|
db_fakes.stub_out_db_instance_api(self.stubs)
|
||||||
stubs.stub_out_get_target(self.stubs)
|
|
||||||
xenapi_fake.reset()
|
xenapi_fake.reset()
|
||||||
self.instance_values = {'id': 1,
|
self.instance_values = {'id': 1,
|
||||||
'project_id': self.user_id,
|
'project_id': self.user_id,
|
||||||
@@ -844,7 +843,6 @@ class XenAPIMigrateInstance(test.TestCase):
|
|||||||
'Dom0IptablesFirewallDriver')
|
'Dom0IptablesFirewallDriver')
|
||||||
stubs.stubout_session(self.stubs, stubs.FakeSessionForVMTests)
|
stubs.stubout_session(self.stubs, stubs.FakeSessionForVMTests)
|
||||||
db_fakes.stub_out_db_instance_api(self.stubs)
|
db_fakes.stub_out_db_instance_api(self.stubs)
|
||||||
stubs.stub_out_get_target(self.stubs)
|
|
||||||
xenapi_fake.reset()
|
xenapi_fake.reset()
|
||||||
xenapi_fake.create_network('fake', FLAGS.flat_network_bridge)
|
xenapi_fake.create_network('fake', FLAGS.flat_network_bridge)
|
||||||
self.user_id = 'fake'
|
self.user_id = 'fake'
|
||||||
@@ -1700,7 +1698,6 @@ class XenAPISRSelectionTestCase(test.TestCase):
|
|||||||
"""Unit tests for testing we find the right SR."""
|
"""Unit tests for testing we find the right SR."""
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(XenAPISRSelectionTestCase, self).setUp()
|
super(XenAPISRSelectionTestCase, self).setUp()
|
||||||
stubs.stub_out_get_target(self.stubs)
|
|
||||||
xenapi_fake.reset()
|
xenapi_fake.reset()
|
||||||
|
|
||||||
def test_safe_find_sr_raise_exception(self):
|
def test_safe_find_sr_raise_exception(self):
|
||||||
|
@@ -22,10 +22,8 @@ from eventlet import tpool
|
|||||||
|
|
||||||
from nova.virt.xenapi import connection as xenapi_conn
|
from nova.virt.xenapi import connection as xenapi_conn
|
||||||
from nova.virt.xenapi import fake
|
from nova.virt.xenapi import fake
|
||||||
from nova.virt.xenapi import volume_utils
|
|
||||||
from nova.virt.xenapi import vm_utils
|
from nova.virt.xenapi import vm_utils
|
||||||
from nova.virt.xenapi import vmops
|
from nova.virt.xenapi import vmops
|
||||||
from nova import utils
|
|
||||||
|
|
||||||
|
|
||||||
def stubout_firewall_driver(stubs, conn):
|
def stubout_firewall_driver(stubs, conn):
|
||||||
@@ -73,14 +71,6 @@ def stubout_session(stubs, cls, product_version=(5, 6, 2), **opt_args):
|
|||||||
stubs.Set(tpool, 'execute', lambda m, *a, **kw: m(*a, **kw))
|
stubs.Set(tpool, 'execute', lambda m, *a, **kw: m(*a, **kw))
|
||||||
|
|
||||||
|
|
||||||
def stub_out_get_target(stubs):
|
|
||||||
"""Stubs out _get_target in volume_utils"""
|
|
||||||
def fake_get_target(volume_id):
|
|
||||||
return (None, None)
|
|
||||||
|
|
||||||
stubs.Set(volume_utils, '_get_target', fake_get_target)
|
|
||||||
|
|
||||||
|
|
||||||
def stubout_get_this_vm_uuid(stubs):
|
def stubout_get_this_vm_uuid(stubs):
|
||||||
def f():
|
def f():
|
||||||
vms = [rec['uuid'] for ref, rec
|
vms = [rec['uuid'] for ref, rec
|
||||||
|
Reference in New Issue
Block a user