# Path: hardware/detect_utils.py
# AUXV_FLAGS = ["AT_HWCAP", "AT_HWCAP2", "AT_PAGESZ",
#               "AT_FLAGS", "AT_PLATFORM"]
# AUXV_OPT_FLAGS = ["AT_BASE_PLATFORM"]
# def cmd(cmdline):
# def output_lines(cmdline):
# def parse_lldtool(hw_lst, interface_name, lines):
# def get_lld_status(hw_lst, interface_name):
# def parse_ethtool(hw_lst, interface_name, lines):
# def get_ethtool_status(hw_lst, interface_name):
# def which(program):
#     def is_exe(fpath):
# def size_in_gb(size):
# def clean_str(val):
# def clean_tuples(lst):
# def _get_uuid_x86_64():
# def _get_uuid_ppc64le(hw_lst):
# def get_uuid(hw_lst):
# def get_value(hw_lst, *vect):
# def get_cidr(netmask):
# def from_file(filename):
# def fix_bad_serial(hw_lst, system_uuid, mobo_id, nic_id):
# def get_cpus(hw_lst):
#     def _maybe_int(v):
#     def _get_governor(lcpu):
# def modprobe(module):
# def detect_auxv():
# def parse_ahci(words):
# def parse_dmesg():


import os
import re
import sys
import pexpect
from hardware import detect_utils
            return hwlist
        controllers = cli.ctrl_all_show()
        if not controllers:
            sys.stderr.write('Info: No hpa controller found\n')
            return hwlist

    except Error as expt:
        sys.stderr.write('Info: detect_hpa : %s\n' % expt.value)
        return hwlist

    hwlist.append(('hpa', 'slots', 'count', str(len(controllers))))
    global_pdisk_size = 0
    for controller in controllers:
        try:
            slot = 'slot=%d' % controller[0]
            controllers_infos = cli.ctrl_show(slot)
            for controller_info in controllers_infos.keys():
                hwlist.append(('hpa', slot.replace('=', '_'),
                               controller_info,
                               controllers_infos[controller_info]))
            for _, disks in cli.ctrl_pd_all_show(slot):
                for disk in disks:
                    disk_count += 1
                    hwlist.append(('disk', disk[0], 'type', disk[1]))
                    hwlist.append(('disk', disk[0], 'slot',
                                   str(controller[0])))
                    disk_infos = cli.ctrl_pd_disk_show(slot, disk[0])
                    for disk_info in disk_infos.keys():
                        value = disk_infos[disk_info]
                        if disk_info == 'size':

# Path: hardware/detect_utils.py
# AUXV_FLAGS = ["AT_HWCAP", "AT_HWCAP2", "AT_PAGESZ",
#               "AT_FLAGS", "AT_PLATFORM"]
# AUXV_OPT_FLAGS = ["AT_BASE_PLATFORM"]
# def cmd(cmdline):
# def output_lines(cmdline):
# def parse_lldtool(hw_lst, interface_name, lines):
# def get_lld_status(hw_lst, interface_name):
# def parse_ethtool(hw_lst, interface_name, lines):
# def get_ethtool_status(hw_lst, interface_name):
# def which(program):
#     def is_exe(fpath):
# def size_in_gb(size):
# def clean_str(val):
# def clean_tuples(lst):
# def _get_uuid_x86_64():
# def _get_uuid_ppc64le(hw_lst):
# def get_uuid(hw_lst):
# def get_value(hw_lst, *vect):
# def get_cidr(netmask):
# def from_file(filename):
# def fix_bad_serial(hw_lst, system_uuid, mobo_id, nic_id):
# def get_cpus(hw_lst):
#     def _maybe_int(v):
#     def _get_governor(lcpu):
# def modprobe(module):
# def detect_auxv():
# def parse_ahci(words):
# def parse_dmesg():


# Path: hardware/hpacucli.py
import os
import re
import sys
import pexpect
from hardware import detect_utils

            return hwlist
        controllers = cli.ctrl_all_show()
        if not controllers:
            sys.stderr.write('Info: No hpa controller found\n')
            return hwlist

    except Error as expt:
        sys.stderr.write('Info: detect_hpa : %s\n' % expt.value)
        return hwlist

    hwlist.append(('hpa', 'slots', 'count', str(len(controllers))))
    global_pdisk_size = 0
    for controller in controllers:
        try:
            slot = 'slot=%d' % controller[0]
            controllers_infos = cli.ctrl_show(slot)
            for controller_info in controllers_infos.keys():
                hwlist.append(('hpa', slot.replace('=', '_'),
                               controller_info,
                               controllers_infos[controller_info]))
            for _, disks in cli.ctrl_pd_all_show(slot):
                for disk in disks:
                    disk_count += 1
                    hwlist.append(('disk', disk[0], 'type', disk[1]))
                    hwlist.append(('disk', disk[0], 'slot',
                                   str(controller[0])))
                    disk_infos = cli.ctrl_pd_disk_show(slot, disk[0])
                    for disk_info in disk_infos.keys():
                        value = disk_infos[disk_info]
                        if disk_info == 'size':

                            value = detect_utils.size_in_gb(