From ce312f47be036207ebbc829718c4dd01e2eb742a Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Sat, 7 Aug 2021 16:12:36 +0000 Subject: [PATCH] devices: wire close up as rpc method Normally `DeviceService.close` would be called when the connection was closed on the other end. Expose that close method via RPC so that clients can call it explicitly. This should be mostly useful in testing. --- osbuild/devices.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/osbuild/devices.py b/osbuild/devices.py index 1b5294ab..7546c73e 100644 --- a/osbuild/devices.py +++ b/osbuild/devices.py @@ -80,5 +80,8 @@ class DeviceService(host.Service): if method == "open": r = self.open(args["dev"], args["tree"], args["options"]) return r, None + if method == "close": + r = self.close() + return r, None raise host.ProtocolError("Unknown method")