This file is indexed.

/usr/lib/python3/dist-packages/os_brick/initiator/connectors/fibre_channel_ppc64.py is in python3-os-brick 2.3.0-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
# 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.

from oslo_log import log as logging

from os_brick import initiator
from os_brick.initiator.connectors import fibre_channel
from os_brick.initiator import linuxfc

LOG = logging.getLogger(__name__)


class FibreChannelConnectorPPC64(fibre_channel.FibreChannelConnector):
    """Connector class to attach/detach Fibre Channel volumes on PPC64 arch."""

    platform = initiator.PLATFORM_PPC64

    def __init__(self, root_helper, driver=None,
                 execute=None, use_multipath=False,
                 device_scan_attempts=initiator.DEVICE_SCAN_ATTEMPTS_DEFAULT,
                 *args, **kwargs):
        super(FibreChannelConnectorPPC64, self).__init__(
            root_helper,
            driver=driver,
            execute=execute,
            device_scan_attempts=device_scan_attempts,
            *args, **kwargs)
        self._linuxfc = linuxfc.LinuxFibreChannelPPC64(root_helper, execute)
        self.use_multipath = use_multipath

    def set_execute(self, execute):
        super(FibreChannelConnectorPPC64, self).set_execute(execute)
        self._linuxscsi.set_execute(execute)
        self._linuxfc.set_execute(execute)

    def _get_host_devices(self, possible_devs, lun):
        host_devices = set()
        for pci_num, target_wwn in possible_devs:
            host_device = "/dev/disk/by-path/fc-%s-lun-%s" % (
                target_wwn,
                self._linuxscsi.process_lun_id(lun))
            host_devices.add(host_device)
        return list(host_devices)

    def _get_possible_volume_paths(self, connection_properties, hbas):
        ports = connection_properties['target_wwn']
        it_map = connection_properties['initiator_target_map']
        for hba in hbas:
            if hba['node_name'] in it_map.keys():
                hba['target_wwn'] = it_map.get(hba['node_name'])
        possible_devs = self._get_possible_devices(hbas, ports)
        lun = connection_properties.get('target_lun', 0)
        host_paths = self._get_host_devices(possible_devs, lun)
        return host_paths