Coverage for nova/api/openstack/compute/fping.py: 88%

16 statements  

« prev     ^ index     » next       coverage.py v7.6.12, created at 2025-04-17 15:08 +0000

1# Copyright 2011 Grid Dynamics 

2# Copyright 2011 OpenStack Foundation 

3# All Rights Reserved. 

4# 

5# Licensed under the Apache License, Version 2.0 (the "License"); you may 

6# not use this file except in compliance with the License. You may obtain 

7# a copy of the License at 

8# 

9# http://www.apache.org/licenses/LICENSE-2.0 

10# 

11# Unless required by applicable law or agreed to in writing, software 

12# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 

13# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 

14# License for the specific language governing permissions and limitations 

15# under the License. 

16 

17from webob import exc 

18 

19from nova.api.openstack.compute.schemas import fping as schema 

20from nova.api.openstack import wsgi 

21from nova.api import validation 

22 

23_removal_reason = """\ 

24This API only works with *nova-network*, which was deprecated in the 

2514.0.0 (Newton) release. 

26It fails with HTTP 404 starting from microversion 2.36. 

27It was removed in the 18.0.0 (Rocky) release. 

28""" 

29 

30 

31class FpingController(wsgi.Controller): 

32 

33 @wsgi.expected_errors(410) 

34 @wsgi.removed('18.0.0', _removal_reason) 

35 @validation.query_schema(schema.index_query) 

36 def index(self, req): 

37 raise exc.HTTPGone() 

38 

39 @wsgi.expected_errors(410) 

40 @wsgi.removed('18.0.0', _removal_reason) 

41 @validation.query_schema(schema.show_query) 

42 def show(self, req, id): 

43 raise exc.HTTPGone()