diff sat/plugins/plugin_tickets_import_bugzilla.py @ 2612:3e4e78de9cca

tools (date_utils): moved date_parse to common.date_utils, because it can be used in frontends
author Goffi <goffi@goffi.org>
date Thu, 21 Jun 2018 01:21:44 +0200
parents 26edcf3a30eb
children 56f94936df1e
line wrap: on
line diff
--- a/sat/plugins/plugin_tickets_import_bugzilla.py	Thu Jun 21 01:21:44 2018 +0200
+++ b/sat/plugins/plugin_tickets_import_bugzilla.py	Thu Jun 21 01:21:44 2018 +0200
@@ -26,7 +26,7 @@
 from twisted.internet import defer
 import os.path
 from lxml import etree
-from sat.tools import utils
+from sat.tools.common import date_utils
 
 
 PLUGIN_INFO = {
@@ -68,8 +68,8 @@
         for bug in root.xpath('bug'):
             ticket = {}
             ticket['id'] = bug.findtext('bug_id')
-            ticket['created'] = utils.date_parse(bug.findtext('creation_ts'))
-            ticket['updated'] = utils.date_parse(bug.findtext('delta_ts'))
+            ticket['created'] = date_utils.date_parse(bug.findtext('creation_ts'))
+            ticket['updated'] = date_utils.date_parse(bug.findtext('delta_ts'))
             ticket['title'] = bug.findtext('short_desc')
             reporter_elt = bug.find('reporter')
             ticket['author'] = reporter_elt.get('name')
@@ -103,7 +103,7 @@
                     who = longdesc.find('who')
                     comment = {'id': longdesc.findtext('commentid'),
                                'author_email': who.text,
-                               'published': utils.date_parse(longdesc.findtext('bug_when')),
+                               'published': date_utils.date_parse(longdesc.findtext('bug_when')),
                                'author': who.get('name', who.text),
                                'content': longdesc.findtext('thetext')}
                     comments.append(comment)