Merge "Prevent stale DHCP directories for dhcp agent nodes"
This commit is contained in:
@@ -288,14 +288,9 @@ class Dnsmasq(DhcpLocalProcess):
|
||||
|
||||
confs_dir = os.path.abspath(os.path.normpath(conf.dhcp_confs))
|
||||
|
||||
class FakeNetwork:
|
||||
def __init__(self, net_id):
|
||||
self.id = net_id
|
||||
|
||||
return [
|
||||
c for c in os.listdir(confs_dir)
|
||||
if (uuidutils.is_uuid_like(c) and
|
||||
cls(conf, FakeNetwork(c), root_helper).active)
|
||||
if uuidutils.is_uuid_like(c)
|
||||
]
|
||||
|
||||
def spawn_process(self):
|
||||
|
||||
@@ -940,7 +940,8 @@ tag:tag1,249,%s,%s""".lstrip() % (fake_v6,
|
||||
result = dhcp.Dnsmasq.existing_dhcp_networks(self.conf, 'sudo')
|
||||
|
||||
mock_listdir.assert_called_once_with(path)
|
||||
self.assertEqual(['aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa'],
|
||||
self.assertEqual(['aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa',
|
||||
'bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb'],
|
||||
result)
|
||||
|
||||
def _check_version(self, cmd_out, expected_value):
|
||||
|
||||
Reference in New Issue
Block a user