Skip to content

Commit b4b191f

Browse files
committed
Fix kcidb-submit NotImplemented error
kcidb-submit uses iterative submission functions, which are not migrated to REST interface yet. This patch implement REST submissions with backward compatibility, not fastest yet, but most stable for a moment. Signed-off-by: Denys Fedoryshchenko <denys.f@collabora.com>
1 parent b8cae3b commit b4b191f

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

kcidb/__init__.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,19 @@ def submit_iter(self, data_iter, done_cb=None):
245245
`NotImplementedError`, if not supplied with a project ID or an MQ
246246
topic name at initialization time.
247247
"""
248+
# TODO: Implement futures/parallelism
249+
if self._resturi:
250+
try:
251+
for data in data_iter:
252+
submission_id = self.rest_submit(data)
253+
if done_cb:
254+
done_cb(submission_id)
255+
# pylint: disable=broad-exception-caught
256+
except Exception as e:
257+
print(f"Error submitting report: {e}",
258+
file=sys.stderr)
259+
return None
260+
return None
248261
if not self.mq_publisher:
249262
raise NotImplementedError
250263
return self.mq_publisher.publish_iter(data_iter, done_cb=done_cb)

0 commit comments

Comments
 (0)