Commit fe335190 authored by Dom Sekotill's avatar Dom Sekotill
Browse files

Rename managed_interfaces to list_interfaces in MasterClient

parent ca5315b2
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -59,9 +59,9 @@ class InterfaceMethodsTests(unittest.TestCase):
		assert client2.ctrl_dir == pathlib.Path("/tmp/foo")

	@anyio_mock.with_anyio()
	async def test_managed_interfaces(self):
	async def test_list_interfaces(self):
		"""
		Check managed_interfaces() processes lines of names in a list
		Check list_interfaces() processes lines of names in a list
		"""
		async with self.client as client:
			client.sock.recv.return_value = (
@@ -71,7 +71,7 @@ class InterfaceMethodsTests(unittest.TestCase):
			)

			self.assertListEqual(
				await client.managed_interfaces(),
				await client.list_interfaces(),
				["enp0s0", "enp1s0", "wlp2s0"]
			)

+2 −2
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@ class MasterClient(BaseClient):
		await super().connect(path)
		self.ctrl_dir = path.parent

	async def managed_interfaces(self) -> Set:
	async def list_interfaces(self) -> Set:
		"""
		Return a set of the interfaces currently managed by the daemon
		"""
@@ -70,7 +70,7 @@ class MasterClient(BaseClient):
		If the daemon is not currently managing the interface, it is added to the daemon's 
		interfaces.
		"""
		if ifname not in await self.managed_interfaces():
		if ifname not in await self.list_interfaces():
			await self.add_interface(ifname)
		client = InterfaceClient(logger=self.logger)
		await client.connect(self.ctrl_dir.joinpath(ifname).as_posix())