Fwiw, the same seems to happen if the origin file does not exist and a subtree is unset (I can file a different bug for this). E.g.:
"""
# netplan set --origin-hint 90-some-random-thing-not-on-disk network=null
Traceback (most recent call last):
File "/usr/sbin/netplan", line 23, in <module>
netplan.main()
File "/usr/share/netplan/netplan/cli/core.py", line 50, in main
self.run_command()
File "/usr/share/netplan/netplan/cli/utils.py", line 310, in run_command
self.func()
File "/usr/share/netplan/netplan/cli/commands/set.py", line 53, in run
self.run_command()
File "/usr/share/netplan/netplan/cli/utils.py", line 310, in run_command
self.func()
File "/usr/share/netplan/netplan/cli/commands/set.py", line 106, in command_set
self.write_file(subtree, hint + '.yaml', self.root_dir)
File "/usr/share/netplan/netplan/cli/commands/set.py", line 176, in write_file
raise Exception('Invalid input: {}'.format(set_tree))
Exception: Invalid input: {'network': None}
"""
Fwiw, the same seems to happen if the origin file does not exist and a subtree is unset (I can file a different bug for this). E.g.:
""" random- thing-not- on-disk network=null netplan" , line 23, in <module> netplan/ netplan/ cli/core. py", line 50, in main run_command( ) netplan/ netplan/ cli/utils. py", line 310, in run_command netplan/ netplan/ cli/commands/ set.py" , line 53, in run run_command( ) netplan/ netplan/ cli/utils. py", line 310, in run_command netplan/ netplan/ cli/commands/ set.py" , line 106, in command_set write_file( subtree, hint + '.yaml', self.root_dir) netplan/ netplan/ cli/commands/ set.py" , line 176, in write_file set_tree) )
# netplan set --origin-hint 90-some-
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': None}
"""