diff sat_frontends/jp/cmd_ticket.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
line wrap: on
line diff
--- a/sat_frontends/jp/cmd_ticket.py	Thu Jul 16 09:07:20 2020 +0200
+++ b/sat_frontends/jp/cmd_ticket.py	Thu Jul 16 09:07:26 2020 +0200
@@ -18,12 +18,13 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 
-from . import base
+import json
+import os
 from sat.core.i18n import _
+from sat.tools.common import data_format
 from sat_frontends.jp import common
 from sat_frontends.jp.constants import Const as C
-import json
-import os
+from . import base
 
 __commands__ = ["Ticket"]
 
@@ -50,14 +51,17 @@
     async def start(self):
         await common.fill_well_known_uri(self, os.getcwd(), "tickets", meta_map={})
         try:
-            tickets_data = await self.host.bridge.ticketsGet(
-                self.args.service,
-                self.args.node,
-                self.args.max,
-                self.args.items,
-                "",
-                self.getPubsubExtra(),
-                self.profile,
+            tickets_data = data_format.deserialise(
+                await self.host.bridge.ticketsGet(
+                    self.args.service,
+                    self.args.node,
+                    self.args.max,
+                    self.args.items,
+                    "",
+                    self.getPubsubExtra(),
+                    self.profile,
+                ),
+                type_check=list
             )
         except Exception as e:
             self.disp(f"can't get tickets: {e}", error=True)