示例#1
0
def write_blunk_address_for_excel(sheet, start_column, index, address, name):
    start_column_idx = column_index_from_string(start_column)

    sheet.cell(row=index,
               column=start_column_idx,
               value=util.int2ip4(int(address)))
    sheet.cell(row=index, column=start_column_idx + 1, value=name)
示例#2
0
def is_in_dhcp_range(dhcp_ranges, address):
    result = False
    for dhcp_range in dhcp_ranges:
        start_ip = util.ip42int(dhcp_range.get_property('start'))
        end_ip = util.ip42int(dhcp_range.get_property('end'))
        ip4_address = util.int2ip4(address)
        if start_ip <= address and address <= end_ip:
            result = True
            break
    return result
示例#3
0
def write_dhcp_blunk_address(writer, address):
    row = []
    props = col_config['address']
    for prop in props:
        id = prop['id']
        if id == 'ip_address':
            row.append(util.int2ip4(int(address)))
        elif id == 'state':
            row.append('DHCP_UNASSIGNED')
        else:
            row.append('')
    writer.writerow(row)
示例#4
0
def write_blunk_address(writer, address, name):
    row = []
    props = col_config['address']
    for prop in props:
        id = prop['id']
        if id == 'ip_address':
            row.append(util.int2ip4(int(address)))
        elif id == 'name':
            row.append(name)
        else:
            row.append(None)
    writer.writerow(row)
示例#5
0
def write_dhcp_blunk_address_for_excel(sheet, start_column, index, address):
    row = []
    props = col_config['address']
    for prop in props:
        id = prop['id']
        if id == 'ip_address':
            row.append(util.int2ip4(int(address)))
        elif id == 'state':
            row.append('DHCP_UNASSIGNED')
        else:
            row.append('')

    write_row_for_excel(sheet, start_column, index, row)