Fix bug.
This commit is contained in:
parent
e2b5f71716
commit
66a1e77b8d
|
@ -76,7 +76,7 @@ def main():
|
|||
new_addr = ""
|
||||
dhcp4 = input(f"Do you want to use dynamic address(dhcp) for interface {interface}? (y/n)")
|
||||
if dhcp4.lower() != "y":
|
||||
dhcp4 = "no"
|
||||
dhcp4 = False
|
||||
while new_addr == "":
|
||||
new_addr = input(f"New address for interface {interface}: ")
|
||||
try:
|
||||
|
@ -97,7 +97,7 @@ def main():
|
|||
change_flag = True
|
||||
else:
|
||||
change_flag = True
|
||||
dhcp4 = "true"
|
||||
dhcp4 = True
|
||||
if old_address != None:
|
||||
del addresses[interface]
|
||||
dhcp[interface] = dhcp4
|
||||
|
@ -135,7 +135,7 @@ def main():
|
|||
if dhcp4 != None:
|
||||
netplan_config_yaml['network']['ethernets'][interface]['dhcp4'] = dhcp4
|
||||
nameservers = interface_content.get('nameservers')
|
||||
if nameservers == None and dhcp4 == 'no':
|
||||
if nameservers == None and dhcp4 == False:
|
||||
nameservers = {'addresses': []}
|
||||
if nameservers != None:
|
||||
nameservers_addresses = nameservers.get('addresses')
|
||||
|
|
Loading…
Reference in New Issue