~mabac/svammel/fix-i386-timeout

« back to all changes in this revision

Viewing changes to file-failures.py

  • Committer: Mattias Backman
  • Date: 2011-03-22 10:17:01 UTC
  • Revision ID: mattias.backman@linaro.org-20110322101701-mtw3fz61e88au082
Make file-failures log reported bugs and avoid reporting if logged.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
    get_file_contents,
31
31
    get_interesting_part,
32
32
)
 
33
from logging import (
 
34
    Log,
 
35
    LogEntry,
 
36
)
33
37
 
34
38
 
35
39
class LaunchpadError(Exception):
59
63
    print 'Error: Could not get build status'
60
64
    raise
61
65
 
 
66
bug_log = Log(args.logfile)
62
67
for spph in interesting_spph:
63
68
 
64
69
    if bug_already_filed_by_url(spph.url, get_launchpad()):
66
71
            (spph.package_name, spph.version))
67
72
        continue
68
73
 
 
74
    if bug_log.get_entry(spph.package_name, spph.version, fail_platform) is not None:
 
75
        print_message("Bug already reported for %s version %s. Perhaps it has been " \
 
76
                          "closed or retargeted." % (spph.package_name, spph.version))
 
77
        continue
 
78
 
69
79
    log = spph.get_arch(fail_platform)
70
80
    if log is not None:
71
81
        build_log = get_file_contents(log.build_log_url)
89
99
    print_message(
90
100
        "Will file bug for %s\n desc: %s\n title:  %s\n tags: %s" %
91
101
        (spph.package_name, bug_description[0:220], bug_title, bug_tags))
92
 
    file_bug_by_url(spph.url, bug_description, bug_title,
93
 
                    bug_tags, get_launchpad())
 
102
    bug = file_bug_by_url(spph.url, bug_description, bug_title,
 
103
                          bug_tags, get_launchpad())
 
104
    if bug is not None and args.logfile is not None:
 
105
        bug_log.write_entry(LogEntry(spph.package_name, spph.version, fail_platform, bug.self_link).to_string())