comparison dns.py @ 65:49a69852a4f4

let's get in less trouble by using dhcp more universally
author drewp@bigasterisk.com
date Wed, 04 May 2022 23:37:27 -0700
parents b46df76991b6
children 136d86d06ce6
comparison
equal deleted inserted replaced
64:32b32ee2211a 65:49a69852a4f4
21 lanscape_config = resp.json() 21 lanscape_config = resp.json()
22 22
23 dhcp_hosts = tempfile.NamedTemporaryFile(mode='wt', encoding='ascii') 23 dhcp_hosts = tempfile.NamedTemporaryFile(mode='wt', encoding='ascii')
24 dhcp_hosts.write("# written by pyinfra\n\n") 24 dhcp_hosts.write("# written by pyinfra\n\n")
25 for row in lanscape_config['dhcp_table']: 25 for row in lanscape_config['dhcp_table']:
26 dhcp_hosts.write(f'{row["mac"]},{row["hostname"]},{row["ip"]},infinite\n') 26 dhcp_hosts.write(f'{row["mac"]},{row["hostname"]},{row["ip"]},24h\n')
27 dhcp_hosts.flush() 27 dhcp_hosts.flush()
28 return dhcp_hosts 28 return dhcp_hosts
29 29
30 30
31 if host.name == 'bang': 31 if host.name == 'bang':