def destroy(self, context=None): """Delete the ResourceProvider from the DB. :param context: Security context. NOTE: This should only be used internally by the indirection_api. Unfortunately, RPC requires context as the first argument, even though we don't use it. A context should be set when instantiating the object, e.g.: ResourceProvider(context) """ dbapi.destroy_resource_provider(context, self.uuid) self.obj_reset_changes()
def test_destroy_resource_provider_by_uuid(self): provider = utils.create_test_resource_provider(context=self.context) dbapi.destroy_resource_provider(self.context, provider.uuid) self.assertRaises(exception.ResourceProviderNotFound, dbapi.get_resource_provider, self.context, provider.uuid)