Merge "Host aggregate configuration throws exception"
This commit is contained in:
@@ -5003,6 +5003,9 @@ class ComputeManager(manager.SchedulerDependentManager):
|
||||
try:
|
||||
self.driver.add_to_aggregate(context, aggregate, host,
|
||||
slave_info=slave_info)
|
||||
except NotImplementedError:
|
||||
LOG.debug(_('Hypervisor driver does not support '
|
||||
'add_aggregate_host'))
|
||||
except exception.AggregateError:
|
||||
with excutils.save_and_reraise_exception():
|
||||
self.driver.undo_aggregate_operation(
|
||||
@@ -5020,6 +5023,9 @@ class ComputeManager(manager.SchedulerDependentManager):
|
||||
try:
|
||||
self.driver.remove_from_aggregate(context, aggregate, host,
|
||||
slave_info=slave_info)
|
||||
except NotImplementedError:
|
||||
LOG.debug(_('Hypervisor driver does not support '
|
||||
'remove_aggregate_host'))
|
||||
except (exception.AggregateError,
|
||||
exception.InvalidAggregateAction) as e:
|
||||
with excutils.save_and_reraise_exception():
|
||||
|
@@ -797,27 +797,6 @@ class PowerVMDriverTestCase(test.TestCase):
|
||||
uptime = self.powervm_connection.get_host_uptime(None)
|
||||
self.assertEquals(output[0], uptime)
|
||||
|
||||
def test_add_to_aggregate(self):
|
||||
# Simple test to make sure the unimplemented method passes.
|
||||
self.powervm_connection.add_to_aggregate(context.get_admin_context(),
|
||||
aggregate={'name': 'foo'},
|
||||
host='fake')
|
||||
|
||||
def test_remove_from_aggregate(self):
|
||||
# Simple test to make sure the unimplemented method passes.
|
||||
self.powervm_connection.remove_from_aggregate(
|
||||
context.get_admin_context(), aggregate={'name': 'foo'},
|
||||
host='fake')
|
||||
|
||||
def test_undo_aggregate_operation(self):
|
||||
# Simple test to make sure the unimplemented method passes.
|
||||
def fake_operation(*args, **kwargs):
|
||||
pass
|
||||
|
||||
self.powervm_connection.undo_aggregate_operation(
|
||||
context.get_admin_context(), op=fake_operation,
|
||||
aggregate={'name': 'foo'}, host='fake')
|
||||
|
||||
def test_plug_vifs(self):
|
||||
# Check to make sure the method raises NotImplementedError.
|
||||
self.assertRaises(NotImplementedError,
|
||||
|
@@ -438,12 +438,6 @@ class FakeDriver(driver.ComputeDriver):
|
||||
def get_disk_available_least(self):
|
||||
pass
|
||||
|
||||
def add_to_aggregate(self, context, aggregate, host, **kwargs):
|
||||
pass
|
||||
|
||||
def remove_from_aggregate(self, context, aggregate, host, **kwargs):
|
||||
pass
|
||||
|
||||
def get_volume_connector(self, instance):
|
||||
return {'ip': '127.0.0.1', 'initiator': 'fake', 'host': 'fakehost'}
|
||||
|
||||
|
@@ -4666,20 +4666,6 @@ class LibvirtDriver(driver.ComputeDriver):
|
||||
pass
|
||||
return output
|
||||
|
||||
def add_to_aggregate(self, context, aggregate, host, **kwargs):
|
||||
"""Add a compute host to an aggregate."""
|
||||
#NOTE(jogo) Currently only used for XenAPI-Pool
|
||||
pass
|
||||
|
||||
def remove_from_aggregate(self, context, aggregate, host, **kwargs):
|
||||
"""Remove a compute host from an aggregate."""
|
||||
pass
|
||||
|
||||
def undo_aggregate_operation(self, context, op, aggregate,
|
||||
host, set_error=True):
|
||||
"""only used for Resource Pools."""
|
||||
pass
|
||||
|
||||
def instance_on_disk(self, instance):
|
||||
# ensure directories exist and are writable
|
||||
instance_path = libvirt_utils.get_instance_path(instance)
|
||||
|
@@ -337,16 +337,3 @@ class PowerVMDriver(driver.ComputeDriver):
|
||||
|
||||
if power_on:
|
||||
self._powervm.power_on(instance['name'])
|
||||
|
||||
def add_to_aggregate(self, context, aggregate, host, **kwargs):
|
||||
"""Add a compute host to an aggregate."""
|
||||
pass
|
||||
|
||||
def remove_from_aggregate(self, context, aggregate, host, **kwargs):
|
||||
"""Remove a compute host from an aggregate."""
|
||||
pass
|
||||
|
||||
def undo_aggregate_operation(self, context, op, aggregate,
|
||||
host, set_error=True):
|
||||
"""Undo for Resource Pools."""
|
||||
pass
|
||||
|
Reference in New Issue
Block a user