Exemple #1
0
 def import_changeset(self, changeset):
     x = self.fisheye
     details = x.get_details(changeset)
     logger.debug(details.comment)
     c = db.CIChangeGit()
     c.comment = unicode(details.comment)
     c.time = strip_timezone(details.get('date'))
     files_list_str = ""
     try:
         files = details.fileRevisionKey
         files_list = []
         for f in files:
             path = (f.get('path'))
             files_list.append(path)
         files_list_str = '#'.join(files_list)
     except AttributeError:
         files_list_str = ''
         files_list = []
     c.file_paths = files_list_str[0:3000]
     c.author = details.get('author')
     c.ci = self.get_ci_by_path(files_list)
     c.changeset = changeset
     c.save()
     ch = db.CIChange()
     ch.type = db.CI_CHANGE_TYPES.CONF_GIT.id
     ch.content_object = c
     ch.ci = c.ci
     ch.priority = db.CI_CHANGE_PRIORITY_TYPES.WARNING.id
     ch.message = c.comment
     ch.time = strip_timezone(details.get('date'))
     ch.save()
Exemple #2
0
 def import_obj(self, issue, classtype):
     logger.debug(issue)
     try:
         ci_obj = db.CI.objects.get(uid=issue.get('ci'))
     except:
         logger.error('Issue : %s Can'
                      't find ci: %s' % (issue.get('key'), issue.get('ci')))
         ci_obj = None
     obj = classtype.objects.filter(jira_id=issue.get('key')).all()
     if obj:
         prob = obj[0]
     else:
         prob = classtype()
     prob.description = issue.get('description', '')
     if prob.description is not None:
         if prob.description and len(prob.description) > 1024:
             prob.description = prob.description[0:1024]
     else:
         prob.description = ''
     prob.summary = issue.get('summary')
     prob.status = issue.get('status')
     prob.assignee = issue.get('assignee')
     prob.ci = ci_obj
     prob.time = strip_timezone(issue.get('time'))  #created or updated
     prob.jira_id = issue.get('key')
     prob.save()
Exemple #3
0
 def import_obj(self, issue, classtype):
     logger.debug(issue)
     try:
         ci_obj=db.CI.objects.get(uid=issue.get('ci'))
     except:
         logger.error('Issue : %s Can''t find ci: %s' % (issue.get('key'),issue.get('ci')))
         ci_obj = None
     obj = classtype.objects.filter(jira_id=issue.get('key')).all()
     if obj:
         prob = obj[0]
     else:
         prob = classtype()
     prob.description = issue.get('description', '')
     if prob.description is not None:
         if prob.description and len(prob.description) > 1024:
             prob.description = prob.description[0:1024]
     else:
         prob.description = ''
     prob.summary = issue.get('summary')
     prob.status = issue.get('status')
     prob.assignee = issue.get('assignee')
     prob.ci = ci_obj
     prob.time = strip_timezone(issue.get('time')) #created or updated
     prob.jira_id = issue.get('key')
     prob.save()
Exemple #4
0
 def import_changeset(self, changeset):
     x = self.fisheye
     details = x.get_details(changeset)
     logger.debug(details.comment)
     c = db.CIChangeGit()
     c.comment = unicode(details.comment)[0:999]
     c.time = strip_timezone(details.get('date'))
     files_list_str = ""
     try:
         files = details.fileRevisionKey
         files_list = []
         for f in files:
             path = (f.get('path'))
             files_list.append(path)
         files_list_str = '#'.join(files_list)
     except AttributeError:
         files_list_str = ''
         files_list = []
     c.file_paths = unicode(files_list_str)[0:3000]
     c.author = details.get('author')
     c.ci = self.get_ci_by_path(files_list)
     c.changeset = changeset
     c.save()
Exemple #5
0
 def import_changeset(self, changeset):
     x = self.fisheye
     details = x.get_details(changeset)
     logger.debug(details.comment)
     c = db.CIChangeGit()
     c.comment = unicode(details.comment)[0:999]
     c.time = strip_timezone(details.get('date'))
     files_list_str = ""
     try:
         files = details.fileRevisionKey
         files_list = []
         for f in files:
             path = (f.get('path'))
             files_list.append(path)
         files_list_str = '#'.join(files_list)
     except AttributeError:
         files_list_str = ''
         files_list = []
     c.file_paths = unicode(files_list_str)[0:3000]
     c.author = details.get('author')
     c.ci = self.get_ci_by_path(files_list)
     c.changeset = changeset
     c.save()
Exemple #6
0
 def tz_time(self, field):
     return strip_timezone(field) if field else None
Exemple #7
0
 def tz_time(self, field):
     return strip_timezone(field) if field else None