This file is indexed.

/usr/lib/python2.7/dist-packages/cinderclient/v2/volume_encryption_types.py is in python-cinderclient 1:1.0.8-0ubuntu1.

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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# Copyright (c) 2013 The Johns Hopkins University/Applied Physics Laboratory
# 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.


"""
Volume Encryption Type interface
"""

from cinderclient import base


class VolumeEncryptionType(base.Resource):
    """
    A Volume Encryption Type is a collection of settings used to conduct
    encryption for a specific volume type.
    """
    def __repr__(self):
        return "<VolumeEncryptionType: %s>" % self.name


class VolumeEncryptionTypeManager(base.ManagerWithFind):
    """
    Manage :class: `VolumeEncryptionType` resources.
    """
    resource_class = VolumeEncryptionType

    def list(self, search_opts=None):
        """
        List all volume encryption types.

        :param volume_types: a list of volume types
        :return: a list of :class: VolumeEncryptionType instances
        """
        # Since the encryption type is a volume type extension, we cannot get
        # all encryption types without going through all volume types.
        volume_types = self.api.volume_types.list()
        encryption_types = []
        for volume_type in volume_types:
            encryption_type = self._get("/types/%s/encryption"
                                        % base.getid(volume_type))
            if hasattr(encryption_type, 'volume_type_id'):
                encryption_types.append(encryption_type)
        return encryption_types

    def get(self, volume_type):
        """
        Get the volume encryption type for the specified volume type.

        :param volume_type: the volume type to query
        :return: an instance of :class: VolumeEncryptionType
        """
        return self._get("/types/%s/encryption" % base.getid(volume_type))

    def create(self, volume_type, specs):
        """
        Create a new encryption type for the specified volume type.

        :param volume_type: the volume type on which to add an encryption type
        :param specs: the encryption type specifications to add
        :return: an instance of :class: VolumeEncryptionType
        """
        body = {'encryption': specs}
        return self._create("/types/%s/encryption" % base.getid(volume_type),
                            body, "encryption")

    def update(self, volume_type, specs):
        """
        Update the encryption type information for the specified volume type.

        :param volume_type: the volume type whose encryption type information
                            must be updated
        :param specs: the encryption type specifications to update
        :return: an instance of :class: VolumeEncryptionType
        """
        raise NotImplementedError()

    def delete(self, volume_type):
        """
        Delete the encryption type information for the specified volume type.

        :param volume_type: the volume type whose encryption type information
                            must be deleted
        """
        return self._delete("/types/%s/encryption/provider" %
                            base.getid(volume_type))