Unset value crashes
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Netplan |
New
|
Undecided
|
Unassigned |
Bug Description
While working on a workaround for https:/
Snapd wants to set a new value, e.g. "network.
However when I do this I get on my test system, I get:
# netplan get
network:
ethernets:
all-en:
dhcp4: true
match:
name: en*
all-eth:
dhcp4: true
match:
name: eth*
version: 2
# netplan set network.
Traceback (most recent call last):
File "/usr/sbin/
netplan.main()
File "/usr/share/
self.
File "/usr/share/
self.func()
File "/usr/share/
self.
File "/usr/share/
self.func()
File "/usr/share/
self.
File "/usr/share/
raise Exception('Invalid input: {}'.format(
Exception: Invalid input: {'network': {'bridges': {'br54': {'dhcp4': None}}}}
I will look again into a workaround for this but it seems this should not crash(?).
summary: |
- Unset value crahes + Unset value crashes |
Hello Michael :)
Quoting Michael Vogt (2021-09-08 12:11:06) /bugs.launchpad .net/netplan/ +bug/1942930 I ran into the following bridges. br54.dhcp4= true" - bridges. br54.dhcp4= true" becomes: bridges. br54.dhcp4= null" and "network. bridges. br54.dhcp4= true".
> Public bug reported:
>
> While working on a workaround for
> https:/
> issue (and maybe I'm holding it wrong, feedback very welcome :).
>
> Snapd wants to set a new value, e.g. "network.
> because of the way snapd works internally it only has a completely
> merged config so it does not know if there was a value or a subtree for
> the given key before but it knows what it should be after. So the new
> workaround code does now unset anythng in snapd that was changed by the
> user. So "network.
> "network.
I'm not clear about your reason for unsetting the key first. Is the set
subcommand unable to replace an existing value?
[...] bridges. br54.dhcp4= null 90-snapd-conf netplan" , line 23, in <module> netplan/ netplan/ cli/core. py", line 50, in main netplan/ netplan/ cli/utils. py", line 264, in run_command netplan/ netplan/ cli/commands/ set.py" , line 52, in run netplan/ netplan/ cli/utils. py", line 264, in run_command netplan/ netplan/ cli/commands/ set.py" , line 98, in command_set file(subtree, hint + '.yaml', self.root_dir) netplan/ netplan/ cli/commands/ set.py" , line 167, in write_file set_tree) )
> # netplan set network.
> Traceback (most recent call last):
> File "/usr/sbin/
> netplan.main()
> File "/usr/share/
> self.run_command()
> File "/usr/share/
> self.func()
> File "/usr/share/
> self.run_command()
> File "/usr/share/
> self.func()
> File "/usr/share/
> self.write_
> File "/usr/share/
> raise Exception('Invalid input: {}'.format(
> Exception: Invalid input: {'network': {'bridges': {'br54': {'dhcp4': None}}}}
>
> I will look again into a workaround for this but it seems this should
> not crash(?).
I'm not clear if that's a genuine crash, as in "unexpected program
state", or poor error reporting, but in any case this isn't very
user-friendly :D