~xnox/ubuntu-archive-tools/sru-report-autopkgtest-vomit

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/python

# Copyright (C) 2011  Canonical Ltd.
# Author: Colin Watson <cjwatson@ubuntu.com>

# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 3 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

import sys
from optparse import OptionParser

# See isotracker.py for setup instructions.
from isotracker import ISOTracker


def main():
    parser = OptionParser(usage="Usage: %prog [options] product version")

    parser.add_option('-m', '--milestone',
                      help='post to MILESTONE rather than the default')
    parser.add_option('-n', '--note', default="",
                      help='set the note field on the build')
    parser.add_option('-t', '--target', help='post to an alternate QATracker')

    options, args = parser.parse_args()
    if len(args) < 2:
        parser.error("product and version arguments required")

    isotracker = ISOTracker(target=options.target)
    if options.milestone is None:
        options.milestone = isotracker.default_milestone()

    isotracker.post_build(args[0], args[1], milestone=options.milestone,
                          note=options.note)


if __name__ == '__main__':
    sys.exit(main())