コード例 #1
0
ファイル: resource_provider.py プロジェクト: zwphit/zun
    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()
コード例 #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()
コード例 #3
0
ファイル: test_resource_provider.py プロジェクト: zwphit/zun
 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)
コード例 #4
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)