Beispiel #1
0
    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()
Beispiel #2
0
    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()
Beispiel #3
0
 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)
 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)