mirror of
https://github.com/openSUSE/osc.git
synced 2025-02-08 20:15:47 +01:00
- fixed attribute names for Request() instances (changed "dst_" prefix to "tgt_")
This commit is contained in:
parent
b2838dd88d
commit
6cd837fcb3
@ -1843,7 +1843,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
# for OBS 2.0 and before
|
# for OBS 2.0 and before
|
||||||
try:
|
try:
|
||||||
rdiff = server_diff(apiurl,
|
rdiff = server_diff(apiurl,
|
||||||
r.actions[0].dst_project, r.actions[0].dst_package, None,
|
r.actions[0].tgt_project, r.actions[0].tgt_package, None,
|
||||||
r.actions[0].src_project, r.actions[0].src_package, r.actions[0].src_rev, opts.unified, True)
|
r.actions[0].src_project, r.actions[0].src_package, r.actions[0].src_rev, opts.unified, True)
|
||||||
except urllib2.HTTPError, e:
|
except urllib2.HTTPError, e:
|
||||||
if e.code != 400:
|
if e.code != 400:
|
||||||
@ -1852,7 +1852,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
# backward compatiblity: only a recent api/backend supports the missingok parameter
|
# backward compatiblity: only a recent api/backend supports the missingok parameter
|
||||||
try:
|
try:
|
||||||
rdiff = server_diff(apiurl,
|
rdiff = server_diff(apiurl,
|
||||||
r.actions[0].dst_project, r.actions[0].dst_package, None,
|
r.actions[0].tgt_project, r.actions[0].tgt_package, None,
|
||||||
r.actions[0].src_project, r.actions[0].src_package, r.actions[0].src_rev, opts.unified, False)
|
r.actions[0].src_project, r.actions[0].src_package, r.actions[0].src_rev, opts.unified, False)
|
||||||
except urllib2.HTTPError, e:
|
except urllib2.HTTPError, e:
|
||||||
e.osc_msg = 'Diff not possible'
|
e.osc_msg = 'Diff not possible'
|
||||||
|
12
osc/core.py
12
osc/core.py
@ -3520,10 +3520,11 @@ def change_request_state_template(req, newstate):
|
|||||||
tmpl = conf.config.get(tmpl_name, '')
|
tmpl = conf.config.get(tmpl_name, '')
|
||||||
tmpl = tmpl.replace('\\t', '\t').replace('\\n', '\n')
|
tmpl = tmpl.replace('\\t', '\t').replace('\\n', '\n')
|
||||||
data = {'reqid': req.reqid, 'type': action.type, 'who': req.get_creator()}
|
data = {'reqid': req.reqid, 'type': action.type, 'who': req.get_creator()}
|
||||||
|
# XXX: change also mapping key to tgt_ prefix
|
||||||
if req.actions[0].type == 'submit':
|
if req.actions[0].type == 'submit':
|
||||||
data.update({'src_project': action.src_project,
|
data.update({'src_project': action.src_project,
|
||||||
'src_package': action.src_package, 'src_rev': action.src_rev,
|
'src_package': action.src_package, 'src_rev': action.src_rev,
|
||||||
'dst_project': action.dst_project, 'dst_package': action.dst_package})
|
'dst_project': action.tgt_project, 'dst_package': action.tgt_package})
|
||||||
try:
|
try:
|
||||||
return tmpl % data
|
return tmpl % data
|
||||||
except KeyError, e:
|
except KeyError, e:
|
||||||
@ -3640,12 +3641,13 @@ def get_request_log(apiurl, reqid):
|
|||||||
r = get_request(apiurl, reqid)
|
r = get_request(apiurl, reqid)
|
||||||
data = []
|
data = []
|
||||||
frmt = '-' * 76 + '\n%s | %s | %s\n\n%s'
|
frmt = '-' * 76 + '\n%s | %s | %s\n\n%s'
|
||||||
|
r.statehistory.reverse()
|
||||||
# the description of the request is used for the initial log entry
|
# the description of the request is used for the initial log entry
|
||||||
# otherwise its comment attribute would contain None
|
# otherwise its comment attribute would contain None
|
||||||
if len(r.statehistory) >= 1:
|
if len(r.statehistory) >= 1:
|
||||||
r.statehistory[-1].comment = r.descr
|
r.statehistory[-1].comment = r.description
|
||||||
else:
|
else:
|
||||||
r.state.comment = r.descr
|
r.state.comment = r.description
|
||||||
for state in [ r.state ] + r.statehistory:
|
for state in [ r.state ] + r.statehistory:
|
||||||
s = frmt % (state.name, state.who, state.when, str(state.comment))
|
s = frmt % (state.name, state.who, state.when, str(state.comment))
|
||||||
data.append(s)
|
data.append(s)
|
||||||
@ -5814,12 +5816,12 @@ def request_interactive_review(apiurl, request):
|
|||||||
tmpfile = tempfile.NamedTemporaryFile()
|
tmpfile = tempfile.NamedTemporaryFile()
|
||||||
# backward compatiblity: only a recent api/backend supports the missingok parameter
|
# backward compatiblity: only a recent api/backend supports the missingok parameter
|
||||||
try:
|
try:
|
||||||
diff = server_diff(apiurl, request.actions[0].dst_project, request.actions[0].dst_package, None,
|
diff = server_diff(apiurl, request.actions[0].tgt_project, request.actions[0].tgt_package, None,
|
||||||
request.actions[0].src_project, request.actions[0].src_package, request.actions[0].src_rev, True, True)
|
request.actions[0].src_project, request.actions[0].src_package, request.actions[0].src_rev, True, True)
|
||||||
except urllib2.HTTPError, e:
|
except urllib2.HTTPError, e:
|
||||||
if e.code == 400:
|
if e.code == 400:
|
||||||
try:
|
try:
|
||||||
diff = server_diff(apiurl, request.actions[0].dst_project, request.actions[0].dst_package, None,
|
diff = server_diff(apiurl, request.actions[0].tgt_project, request.actions[0].tgt_package, None,
|
||||||
request.actions[0].src_project, request.actions[0].src_package, request.actions[0].src_rev, True, False)
|
request.actions[0].src_project, request.actions[0].src_package, request.actions[0].src_rev, True, False)
|
||||||
except urllib2.HTTPError, e:
|
except urllib2.HTTPError, e:
|
||||||
tmpfile.close()
|
tmpfile.close()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user