I can confirm these issues and prepared a few reproducer testcases (for test_cli_get_set.py), let's try to get those resolved!
def test_set_empty_hint_file(self): empty_file = os.path.join(self.workdir.name, 'etc', 'netplan', '00-empty.yaml') open(empty_file, 'w').close() # touch empty file self._set(['ethernets.eth0.dhcp4=true', '--origin-hint=00-empty']) print(empty_file, flush=True) self.assertTrue(os.path.isfile(empty_file)) with open(empty_file, 'r') as f: self.assertIn('network:\n ethernets:\n eth0:\n dhcp4: true', f.read())
def test_set_network_null_hint(self): not_a_file = os.path.join(self.workdir.name, 'etc', 'netplan', '00-no-exist.yaml') self._set(['network=null', '--origin-hint=00-no-exist']) self.assertFalse(os.path.isfile(not_a_file))
def test_set_network_null(self): not_a_file = os.path.join(self.workdir.name, 'etc', 'netplan', '00-no-exist.yaml') self._set(['network=null']) self.assertFalse(os.path.isfile(not_a_file))
I can confirm these issues and prepared a few reproducer testcases (for test_cli_ get_set. py), let's try to get those resolved!
def test_set_ empty_hint_ file(self) : join(self. workdir. name, 'etc', 'netplan', '00-empty.yaml')
open(empty_ file, 'w').close() # touch empty file
self._ set(['ethernets .eth0.dhcp4= true', '--origin- hint=00- empty'] )
print( empty_file, flush=True)
self.assertTru e(os.path. isfile( empty_file) )
self. assertIn( 'network: \n ethernets:\n eth0:\n dhcp4: true', f.read())
empty_file = os.path.
with open(empty_file, 'r') as f:
def test_set_ network_ null_hint( self): join(self. workdir. name, 'etc', 'netplan', '00-no-exist.yaml')
self._ set(['network= null', '--origin- hint=00- no-exist' ])
self.assertFal se(os.path. isfile( not_a_file) )
not_a_file = os.path.
def test_set_ network_ null(self) : join(self. workdir. name, 'etc', 'netplan', '00-no-exist.yaml')
self._ set(['network= null'])
self.assertFal se(os.path. isfile( not_a_file) )
not_a_file = os.path.