diff sat_frontends/jp/cmd_merge_request.py @ 3309:71761e9fb984

plugins tickets, merge-requests: `ticketsGet` and `mergeRequestsGet` serialisation: those methods now return data serialised with `data_format.serialise`
author Goffi <goffi@goffi.org>
date Thu, 16 Jul 2020 09:07:26 +0200
parents 559a625a236b
children be6d91572633
line wrap: on
line diff
--- a/sat_frontends/jp/cmd_merge_request.py	Thu Jul 16 09:07:20 2020 +0200
+++ b/sat_frontends/jp/cmd_merge_request.py	Thu Jul 16 09:07:26 2020 +0200
@@ -129,14 +129,16 @@
             self, os.getcwd(), "merge requests", meta_map={})
         extra = {}
         try:
-            requests_data = await self.host.bridge.mergeRequestsGet(
-                self.args.service,
-                self.args.node,
-                self.args.max,
-                self.args.items,
-                "",
-                extra,
-                self.profile,
+            requests_data = data_format.deserialise(
+                await self.host.bridge.mergeRequestsGet(
+                    self.args.service,
+                    self.args.node,
+                    self.args.max,
+                    self.args.items,
+                    "",
+                    extra,
+                    self.profile,
+                )
             )
         except Exception as e:
             self.disp(f"can't get merge request: {e}", error=True)
@@ -146,7 +148,7 @@
             whitelist = None
         else:
             whitelist = {"id", "title", "body"}
-        for request_xmlui in requests_data[0]:
+        for request_xmlui in requests_data['items']:
             xmlui = xmlui_manager.create(self.host, request_xmlui, whitelist=whitelist)
             await xmlui.show(values_only=True)
             self.disp("")