This file is indexed.

/usr/lib/python2.7/dist-packages/magnum/api/http_error.py is in python-magnum 3.1.1-5.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# All Rights Reserved.
#
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
#    not use this file except in compliance with the License. You may obtain
#    a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.

import json
import six
from webob import exc


class HTTPNotAcceptableAPIVersion(exc.HTTPNotAcceptable):
    # subclass of :class:`~HTTPNotAcceptable`
    #
    # This indicates the resource identified by the request is only
    # capable of generating response entities which have content
    # characteristics not acceptable according to the accept headers
    # sent in the request.
    #
    # code: 406, title: Not Acceptable
    #
    # differences from webob.exc.HTTPNotAcceptable:
    #
    # - additional max and min version parameters
    # - additional error info for code, title, and links
    code = 406
    title = 'Not Acceptable'
    max_version = ''
    min_version = ''

    def __init__(self, detail=None, headers=None, comment=None,
                 body_template=None, max_version='', min_version='', **kw):

        super(HTTPNotAcceptableAPIVersion, self).__init__(
            detail=detail, headers=headers, comment=comment,
            body_template=body_template, **kw)

        self.max_version = max_version
        self.min_version = min_version

    def __call__(self, environ, start_response):
        for err_str in self.app_iter:
            err = {}
            try:
                err = json.loads(err_str.decode('utf-8'))
            except ValueError:
                pass

            links = {'rel': 'help', 'href': 'http://developer.openstack.org'
                     '/api-guide/compute/microversions.html'}

            err['max_version'] = self.max_version
            err['min_version'] = self.min_version
            err['code'] = "magnum.microversion-unsupported"
            err['links'] = [links]
            err['title'] = "Requested microversion is unsupported"

        self.app_iter = [six.b(json.dumps(err))]
        self.headers['Content-Length'] = str(len(self.app_iter[0]))

        return super(HTTPNotAcceptableAPIVersion, self).__call__(
            environ, start_response)