summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/prserv/client.py
diff options
context:
space:
mode:
authorPaul Barker <pbarker@konsulko.com>2021-08-19 12:46:44 -0400
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-08-23 08:30:55 +0100
commit295b75cf1cc17f9ab3990d9640a72af83a593a77 (patch)
tree326994f9e533bea5c008174aee38d6ed9fb2a5e9 /bitbake/lib/prserv/client.py
parentfb3b05fe8da817967c9f90d4c4c0c1fee87c9f01 (diff)
downloadpoky-295b75cf1cc17f9ab3990d9640a72af83a593a77.tar.gz
bitbake: prserv: Add read-only mode
[YOCTO #13659] (Bitbake rev: 44287430b9804fcbf2440f85a2424792140e4dc9) Signed-off-by: Paul Barker <pbarker@konsulko.com> [updated for asyncrpc changes] Signed-off-by: Scott Murray <scott.murray@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/prserv/client.py')
-rw-r--r--bitbake/lib/prserv/client.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/bitbake/lib/prserv/client.py b/bitbake/lib/prserv/client.py
index 285dce72f6..a3f19ddafc 100644
--- a/bitbake/lib/prserv/client.py
+++ b/bitbake/lib/prserv/client.py
@@ -32,10 +32,17 @@ class PRAsyncClient(bb.asyncrpc.AsyncClient):
32 if response: 32 if response:
33 return (response['metainfo'], response['datainfo']) 33 return (response['metainfo'], response['datainfo'])
34 34
35 async def is_readonly(self):
36 response = await self.send_message(
37 {'is-readonly': {}}
38 )
39 if response:
40 return response['readonly']
41
35class PRClient(bb.asyncrpc.Client): 42class PRClient(bb.asyncrpc.Client):
36 def __init__(self): 43 def __init__(self):
37 super().__init__() 44 super().__init__()
38 self._add_methods('getPR', 'importone', 'export') 45 self._add_methods('getPR', 'importone', 'export', 'is_readonly')
39 46
40 def _get_async_client(self): 47 def _get_async_client(self):
41 return PRAsyncClient() 48 return PRAsyncClient()