~fginther/jenkins-launchpad-plugin/dev-disable-gensymbols

« back to all changes in this revision

Viewing changes to updateMergeProposal.py

Adding links to console output. Fixes: https://bugs.launchpad.net/bugs/1009003. Approved by Sergio Schvezov, jenkins.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/env python
2
 
 
3
2
import getopt, sys
4
3
from argparse import ArgumentParser
5
4
from settings import *
6
 
from launchpad import LaunchpadAgent
 
5
from launchpad import LaunchpadTrigger
 
6
from jsonjenkins import JSONJenkins
7
7
 
8
8
 
9
9
class UpdateMergeProposalException(Exception):
78
78
                        help="report that the commit message was left empty")
79
79
    args = vars(parser.parse_args())
80
80
 
81
 
    launchpad = LaunchpadAgent()
 
81
    launchpad = LaunchpadTrigger()
82
82
 
83
83
    try:
84
84
        mp_state, message, subject = build_state(args)
92
92
        if not args['branch']:
93
93
            parser.error('Error: unable to get branch from merge proposal.\n'+
94
94
                            'Please specify manually using --branch.')
95
 
    args['job_url'] = launchpad.hide_jenkins_url(args['job_url'])
96
95
    mp = launchpad.get_merge_proposal(args['branch'], args['merge_proposal'])
97
96
    if not mp:
98
97
        parser.error('Error: merge proposal relted '+
99
98
                      'to this branch was not found')
100
99
    if message:
101
 
        message = message + args['job_url']
 
100
        message = (message + launchpad.hide_jenkins_url(args['job_url']) + 
 
101
                   launchpad.get_executed_test_runs(args['job_url']))
102
102
    launchpad.change_mp_status(mp, mp_state, message, subject, 
103
103
                               args['revision'], args['vote'])
104
104
    return 0