Yes. Looks like you discovered a bug here. It works if you unset an "interface subtree", e.g.: $ sudo netplan set network.bridges.br54=null
But apparently not if you delete a whole set of devices, that might be spread across a set of YAML files (like network.bridges=null, network=null).
I can reproduce the issue with a simple unit-test in `test_clie_get_set.py` and we should fix it.
def test_set_delete_subtree(self): with open(self.path, 'w') as f: f.write('''network:\n version: 2\n renderer: NetworkManager ethernets: eth0: {addresses: [1.2.3.4/24]}''') ret = self._set(['network.ethernets=null']) print(ret, flush=True) # debugging self.assertTrue(os.path.isfile(self.path)) with open(self.path, 'r') as f: out = f.read() print(out, flush=True) # debugging self.assertIn('network:\n', out) self.assertIn(' version: 2\n', out) self.assertIn(' renderer: NetworkManager\n', out) self.assertNotIn('ethernets:', out)
Yes. Looks like you discovered a bug here. bridges. br54=null
It works if you unset an "interface subtree", e.g.:
$ sudo netplan set network.
But apparently not if you delete a whole set of devices, that might be spread across a set of YAML files (like network. bridges= null, network=null).
I can reproduce the issue with a simple unit-test in `test_clie_ get_set. py` and we should fix it.
def test_set_ delete_ subtree( self):
f. write(' ''network: \n version: 2\n renderer: NetworkManager ['network. ethernets= null'])
self.assertTru e(os.path. isfile( self.path) )
print( out, flush=True) # debugging
self. assertIn( 'network: \n', out)
self. assertIn( ' version: 2\n', out)
self. assertIn( ' renderer: NetworkManager\n', out)
self. assertNotIn( 'ethernets: ', out)
with open(self.path, 'w') as f:
ethernets:
eth0: {addresses: [1.2.3.4/24]}''')
ret = self._set(
print(ret, flush=True) # debugging
with open(self.path, 'r') as f:
out = f.read()