mirror of
https://github.com/KevinMidboe/mktxp-no-cli.git
synced 2025-10-29 17:50:23 +00:00
DS refactor, fixes/optimizations
This commit is contained in:
@@ -42,12 +42,11 @@ class CapsmanOutput:
|
|||||||
else:
|
else:
|
||||||
dhcp_rt_by_interface[interface] = [registration_record]
|
dhcp_rt_by_interface[interface] = [registration_record]
|
||||||
|
|
||||||
|
output_records = 0
|
||||||
|
registration_records = len(registration_records)
|
||||||
output_entry = BaseOutputProcessor.OutputCapsmanEntry
|
output_entry = BaseOutputProcessor.OutputCapsmanEntry
|
||||||
output_table = BaseOutputProcessor.output_table(output_entry)
|
output_table = BaseOutputProcessor.output_table(output_entry)
|
||||||
|
|
||||||
output_records = 0
|
|
||||||
registration_records = len(registration_records)
|
|
||||||
for key in dhcp_rt_by_interface.keys():
|
for key in dhcp_rt_by_interface.keys():
|
||||||
for record in dhcp_rt_by_interface[key]:
|
for record in dhcp_rt_by_interface[key]:
|
||||||
output_table.add_row(output_entry(**record))
|
output_table.add_row(output_entry(**record))
|
||||||
|
|||||||
@@ -35,11 +35,11 @@ class DHCPOutput:
|
|||||||
else:
|
else:
|
||||||
dhcp_by_server[server] = [dhcp_lease_record]
|
dhcp_by_server[server] = [dhcp_lease_record]
|
||||||
|
|
||||||
|
output_records = 0
|
||||||
|
lease_records = len(dhcp_lease_records)
|
||||||
output_entry = BaseOutputProcessor.OutputDHCPEntry
|
output_entry = BaseOutputProcessor.OutputDHCPEntry
|
||||||
output_table = BaseOutputProcessor.output_table(output_entry)
|
output_table = BaseOutputProcessor.output_table(output_entry)
|
||||||
|
|
||||||
output_records = 0
|
|
||||||
lease_records = len(dhcp_lease_records)
|
|
||||||
for key in dhcp_by_server.keys():
|
for key in dhcp_by_server.keys():
|
||||||
for record in dhcp_by_server[key]:
|
for record in dhcp_by_server[key]:
|
||||||
record['host_name'] = BaseOutputProcessor.dhcp_name(router_entry, record, drop_comment = True)
|
record['host_name'] = BaseOutputProcessor.dhcp_name(router_entry, record, drop_comment = True)
|
||||||
|
|||||||
@@ -42,11 +42,11 @@ class WirelessOutput:
|
|||||||
else:
|
else:
|
||||||
dhcp_rt_by_interface[interface] = [registration_record]
|
dhcp_rt_by_interface[interface] = [registration_record]
|
||||||
|
|
||||||
|
output_records = 0
|
||||||
|
registration_records = len(registration_records)
|
||||||
output_entry = BaseOutputProcessor.OutputWiFiEntry
|
output_entry = BaseOutputProcessor.OutputWiFiEntry
|
||||||
output_table = BaseOutputProcessor.output_table(output_entry)
|
output_table = BaseOutputProcessor.output_table(output_entry)
|
||||||
|
|
||||||
output_records = 0
|
|
||||||
registration_records = len(registration_records)
|
|
||||||
for key in dhcp_rt_by_interface.keys():
|
for key in dhcp_rt_by_interface.keys():
|
||||||
for record in dhcp_rt_by_interface[key]:
|
for record in dhcp_rt_by_interface[key]:
|
||||||
output_table.add_row(output_entry(**record))
|
output_table.add_row(output_entry(**record))
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
## GNU General Public License for more details.
|
## GNU General Public License for more details.
|
||||||
|
|
||||||
|
|
||||||
import re, os
|
import re, os
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|||||||
Reference in New Issue
Block a user