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}
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 }
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