예제 #1
0
def sync_bugmail():
    """
    Check bugmail for updated bugs, and get their data from Bugzilla.
    """
    bugids = get_bugmails()
    if bugids:
        numbugs = len(bugids)
        url = BugzillaURL(url=get_bz_url_for_bug_ids(bugids))
        try:
            url.get_bugs(open_only=False)
        except BZError:
            # error logged in `get_bugs`
            log.error('Failed to update bugs from email: %s', bugids)
            return
        if NEW_RELIC:
            newrelic.agent.record_custom_metric('Custom/Bugmails', numbugs)
        log.info('Synced %d bug(s) from email', numbugs)
예제 #2
0
def sync_bugmail():
    """
    Check bugmail for updated bugs, and get their data from Bugzilla.
    """
    bugids = get_bugmails()
    if bugids:
        numbugs = len(bugids)
        url = BugzillaURL(url=get_bz_url_for_bug_ids(bugids))
        try:
            url.get_bugs(open_only=False)
        except BZError:
            # error logged in `get_bugs`
            log.error('Failed to update bugs from email: %s', bugids)
            return
        if NEW_RELIC:
            newrelic.agent.record_custom_metric('Custom/Bugmails', numbugs)
        log.info('Synced %d bug(s) from email', numbugs)
예제 #3
0
파일: cron.py 프로젝트: willkg/scrumbugz
def sync_bugmail():
    """
    Check bugmail for updated bugs, and get their data from Bugzilla.
    """
    counter = 0
    bugids = get_bugmails()
    for slug, ids in bugids.items():
        counter += len(ids)
        url = BugzillaURL(url=get_bz_url_for_bug_ids(ids))
        proj = None
        if slug:
            try:
                proj = Project.objects.get(slug=slug)
            except Project.DoesNotExist:
                pass
        if proj:
            url.project = proj
        url.get_bugs()
        sys.stdout.write('.')
        sys.stdout.flush()
    if counter:
        print "\nSynced {0} bugs".format(counter)
예제 #4
0
 def test_get_bugmails(self):
     good_data = [760693, 760694]
     eq_(good_data, scrum_email.get_bugmails())
예제 #5
0
파일: tests.py 프로젝트: willkg/scrumbugz
 def test_get_bugmails(self):
     good_data = {
         None: [760693],
         'mdn': [760694],
     }
     eq_(good_data, scrum_email.get_bugmails())
예제 #6
0
 def test_get_bugmails(self):
     good_data = [760693, 760694]
     eq_(good_data, scrum_email.get_bugmails())