sources: use high level message dispatcher
Use the new `BaseAPI._message` high level message dispatcher that is more convenient to use.
This commit is contained in:
parent
93c1be4c5f
commit
f8514e782c
1 changed files with 3 additions and 4 deletions
|
|
@ -36,10 +36,9 @@ class SourcesServer(api.BaseAPI):
|
|||
except ValueError:
|
||||
return {"error": f"source returned malformed json: {r.stdout}"}
|
||||
|
||||
def _dispatch(self, server):
|
||||
request, _, addr = server.recv()
|
||||
reply = self._run_source(request["source"], request["checksums"])
|
||||
server.send(reply, destination=addr)
|
||||
def _message(self, msg, fds, sock, addr):
|
||||
reply = self._run_source(msg["source"], msg["checksums"])
|
||||
sock.send(reply, destination=addr)
|
||||
|
||||
|
||||
def get(source, checksums, api_path="/run/osbuild/api/sources"):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue