Ejemplo n.º 1
0
def process(workbook: Any, content: list) -> None:
    """Process Arrays worksheet

    :param workbook:
    :param content:
    """
    worksheet = workbook.get_sheet_by_name('Arrays')

    header = [
        'SystemName', 'ID', 'State', 'Pool', 'Storage Type',
        'Total Capacity (GiB)', 'Allocated Capacity (GiB)',
        'Drive Capacity (GB)'
    ]
    build_header(worksheet, header)

    rows = []  # type: list
    for csv_file in content:
        storage_csv = csv.reader(csv_file.split('\n'))
        system_name = get_rows(storage_csv, ['Name'])
        arrays_rows = get_rows(storage_csv, header[1:])
        rows += [system_name[0] + feat_row for feat_row in arrays_rows]

    final_col, final_row = 0, 0
    for row_n, row_tuple in enumerate(rows, 2):
        for col_n, col_value in \
                enumerate(row_tuple, ord('A')):
            cell = worksheet['{}{}'.format(chr(col_n), row_n)]
            cell.value = str.strip(col_value)
            set_cell_to_number(cell)
            style_value_cell(cell)
            final_col = col_n
        final_row = row_n

    sheet_process_output(worksheet, 'ArraysTable', 'Arrays', final_col,
                         final_row)
Ejemplo n.º 2
0
def process(workbook: Any, content: list) -> None:
    """Process SAN Hosts worksheet

    :param workbook:
    :param content:
    """
    worksheet = workbook.get_sheet_by_name('SAN Hosts')

    header = [
        'SystemName', 'WWPN', 'State', 'Host', 'Type', 'Address Mode',
        'Volumes', 'Number of Accessible I/O Ports', 'Address Discovery',
        'Logical Block Size', 'Host Connect', 'Volume Group'
    ]
    build_header(worksheet, header)

    rows = []  # type: list
    for csv_file in content:
        storage_csv = csv.reader(csv_file.split('\n'))
        system_name = get_rows(storage_csv, ['Name'])
        san_hosts_rows = get_rows(storage_csv, header[1:])
        rows += [system_name[0] + feat_row for feat_row in san_hosts_rows]

    final_col, final_row = 0, 0
    for row_n, row_tuple in enumerate(rows, 2):
        for col_n, col_value in \
                enumerate(row_tuple, ord('A')):
            cell = worksheet['{}{}'.format(chr(col_n), row_n)]
            cell.value = str.strip(col_value)
            set_cell_to_number(cell)
            style_value_cell(cell)
            final_col = col_n
        final_row = row_n

    sheet_process_output(worksheet, 'SANHostsTable', 'SAN Hosts', final_col,
                         final_row)
Ejemplo n.º 3
0
def process(workbook: Any, content: list) -> None:
    """Process Drives worksheet

    :param workbook:
    :param content:
    """
    worksheet = workbook.get_sheet_by_name('Drives')

    header = [
        'SystemName', 'S/N', 'State', 'Array', 'Drive Capacity (GB)',
        'Drive Class', 'Interface', 'Interface Rate (Gbps)', 'Firmware',
        'Location', 'WWNN', 'Encryption'
    ]
    build_header(worksheet, header)

    rows = []  # type: list
    for csv_file in content:
        storage_csv = csv.reader(csv_file.split('\n'))
        system_name = get_rows(storage_csv, ['Name'])
        drives_rows = get_rows(storage_csv, header[1:])
        rows += [system_name[0] + feat_row for feat_row in drives_rows]

    final_col, final_row = 0, 0
    for row_n, row_tuple in enumerate(rows, 2):
        for col_n, col_value in \
                enumerate(row_tuple, ord('A')):
            cell = worksheet['{}{}'.format(chr(col_n), row_n)]
            cell.value = str.strip(col_value)
            set_cell_to_number(cell)
            style_value_cell(cell)
            final_col = col_n
        final_row = row_n

    sheet_process_output(worksheet, 'DrivesTable', 'Drives', final_col,
                         final_row)
Ejemplo n.º 4
0
def process(workbook: Any, content: list) -> None:
    """Process Storage Controllers worksheet

    :param workbook:
    :param content:
    """
    worksheet = workbook.get_sheet_by_name('Storage Controllers')

    header = [
        'Name', 'State', 'Product', 'Release', 'Bundle', 'MTM', 'S/N',
        'Machine Signature', 'WWNN', 'Number of Frames', 'Processors',
        'System Memory (GB)', 'Storage Capacity (TB)', 'Last Power on Time',
        'Install Time', 'Power Control Mode'
    ]
    build_header(worksheet, header)

    rows = []  # type: list
    for csv_file in content:
        storage_csv = csv.reader(csv_file.split('\n'))
        rows += get_rows(storage_csv, header)

    final_col, final_row = 0, 0
    for row_n, row_tuple in enumerate(rows, 2):
        for col_n, col_value in \
                enumerate(row_tuple, ord('A')):
            cell = worksheet['{}{}'.format(chr(col_n), row_n)]
            cell.value = str.strip(col_value)
            set_cell_to_number(cell)
            style_value_cell(cell)
            final_col = col_n
        final_row = row_n

    sheet_process_output(worksheet, 'StorageControllersTable',
                         'Storage Controllers', final_col, final_row)
Ejemplo n.º 5
0
def process(workbook: Any, content: list) -> None:
    """Process Pools worksheet

    :param workbook:
    :param content:
    """
    worksheet = workbook.get_sheet_by_name('Pools')

    header = [
        'SystemName', 'Name', 'Storage Type', 'Total Capacity (GiB)',
        'Allocated Capacity (GiB)', 'Over-provisioned Ratio', 'Threshold',
        'Allocated Capacity for Standard Volumes (GiB)',
        'Allocated Capacity for ESE Volumes (GiB)',
        'Allocated Capacity for TSE Repository (GiB)',
        'Allocated Capacity for Metadata (GiB)', 'Encryption', 'Easy Tier',
        'Number of Arrays', 'Volumes', 'Migrating Capacity'
    ]
    build_header(worksheet, header)

    rows = []  # type: list
    for csv_file in content:
        storage_csv = csv.reader(csv_file.split('\n'))
        system_name = get_rows(storage_csv, ['Name'])
        pools_rows = get_rows(storage_csv, header[1:])
        rows += [system_name[0] + feat_row for feat_row in pools_rows]

    final_col, final_row = 0, 0
    for row_n, row_tuple in enumerate(rows, 2):
        for col_n, col_value in \
                enumerate(row_tuple, ord('A')):
            cell = worksheet['{}{}'.format(chr(col_n), row_n)]
            cell.value = str.strip(col_value)
            set_cell_to_number(cell)
            style_value_cell(cell)
            final_col = col_n
        final_row = row_n

    sheet_process_output(worksheet, 'PoolsTable', 'Pools', final_col,
                         final_row)
Ejemplo n.º 6
0
def process(workbook: Any, content: list) -> None:
    """Process Volumes worksheet

    :param workbook:
    :param content:
    """
    worksheet = workbook.get_sheet_by_name('Volumes')

    header = [
        'SystemName', 'Name', 'State', 'Storage Type', 'Total Capacity (GiB)',
        'Allocated Capacity (GiB)', 'Pool', 'Node', 'LUN ID',
        'Thin-provisioning', 'Allocation Method', 'LSS', 'Address Group',
        'MTM', 'Data Type', 'VOLSER', 'GUID', 'Number of Hosts', 'Scope',
        'Performance Policy', 'Migrating Capacity'
    ]
    build_header(worksheet, header)

    rows = []  # type: list
    for csv_file in content:
        storage_csv = csv.reader(csv_file.split('\n'))
        system_name = get_rows(storage_csv, ['Name'])
        volumes_rows = get_rows(storage_csv, header[1:])
        rows += [system_name[0] + feat_row for feat_row in volumes_rows]

    final_col, final_row = 0, 0
    for row_n, row_tuple in enumerate(rows, 2):
        for col_n, col_value in \
                enumerate(row_tuple, ord('A')):
            cell = worksheet['{}{}'.format(chr(col_n), row_n)]
            cell.value = str.strip(col_value)
            set_cell_to_number(cell)
            style_value_cell(cell)
            final_col = col_n
        final_row = row_n

    sheet_process_output(worksheet, 'VolumesTable', 'Volumes', final_col,
                         final_row)