Пример #1
0
def test(**kwargs):
    net_conf, net_parse = parser.parse_conf(filename='dhcpd.conf', return_parsed=True)
    lease_conf = parser.parse_leases(filename='dhcpd.leases')
    nets = network_objects.build_networks(net_conf)
    leases = network_objects.build_leases(lease_conf)
    return {'PARSED_NETWORKS':net_conf, 
            'PARSED_BRACKETS':net_parse, 
            'PARSED_LEASES':lease_conf, 
            'NETWORKS':nets, 
            'LEASES':leases}
Пример #2
0
def test(**kwargs):
    conf_file = kwargs.get('conf_file', 'dhcpd.conf')
    lease_file = kwargs.get('lease_file', 'dhcpd.leases')
    net_conf, net_parse = parser.parse_conf(filename=conf_file,
                                            return_parsed=True)
    lease_conf = parser.parse_leases(filename=lease_file)
    nets = network_objects.build_networks(net_conf)
    leases = network_objects.build_leases(lease_conf)
    return {
        'PARSED_NETWORKS': net_conf,
        'PARSED_BRACKETS': net_parse,
        'PARSED_LEASES': lease_conf,
        'NETWORKS': nets,
        'LEASES': leases
    }
Пример #3
0
def do_parse():
    net_conf = parser.parse_conf()
    lease_conf = parser.parse_leases()
    nets = network_objects.build_networks(net_conf)
    network_objects.build_leases(lease_conf)
    return nets
Пример #4
0
def do_parse():
    net_conf = parser.parse_conf()
    lease_conf = parser.parse_leases()
    nets = network_objects.build_networks(net_conf)
    network_objects.build_leases(lease_conf)
    return nets