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)
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)
def test_get_bugmails(self): good_data = [760693, 760694] eq_(good_data, scrum_email.get_bugmails())
def test_get_bugmails(self): good_data = { None: [760693], 'mdn': [760694], } eq_(good_data, scrum_email.get_bugmails())