diff --git a/nova/compute/manager.py b/nova/compute/manager.py index 32a082d56052..125776c21d3b 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -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(): diff --git a/nova/tests/virt/powervm/test_powervm.py b/nova/tests/virt/powervm/test_powervm.py index fafb2deede1a..c483f5482f9f 100644 --- a/nova/tests/virt/powervm/test_powervm.py +++ b/nova/tests/virt/powervm/test_powervm.py @@ -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, diff --git a/nova/virt/fake.py b/nova/virt/fake.py index 5c0f906d173c..7baa271275fa 100644 --- a/nova/virt/fake.py +++ b/nova/virt/fake.py @@ -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'} diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py index eba247fd1a61..6c91f78780b2 100644 --- a/nova/virt/libvirt/driver.py +++ b/nova/virt/libvirt/driver.py @@ -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) diff --git a/nova/virt/powervm/driver.py b/nova/virt/powervm/driver.py index a14ed70e4763..a824c97c3313 100644 --- a/nova/virt/powervm/driver.py +++ b/nova/virt/powervm/driver.py @@ -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