Merge pull request #2292 from jberry-suse/origin-manager-remote-pending-update
osclib/origin: origin_update_pending() utilize project_remote_prefixed().
This commit is contained in:
commit
547e954a0b
@ -726,6 +726,17 @@ def project_remote_apiurl(apiurl, project):
|
|||||||
|
|
||||||
return apiurl, project
|
return apiurl, project
|
||||||
|
|
||||||
|
def project_remote_prefixed(apiurl, apiurl_remote, project):
|
||||||
|
if apiurl_remote == apiurl:
|
||||||
|
return project
|
||||||
|
|
||||||
|
remotes = project_remote_list(apiurl)
|
||||||
|
for remote, remote_apiurl in remotes.items():
|
||||||
|
if remote_apiurl == apiurl_remote:
|
||||||
|
return remote + ':' + project
|
||||||
|
|
||||||
|
raise Exception('remote APIURL interconnect not configured for{}'.format(apiurl_remote))
|
||||||
|
|
||||||
def review_find_last(request, user, states=['all']):
|
def review_find_last(request, user, states=['all']):
|
||||||
for review in reversed(request.reviews):
|
for review in reversed(request.reviews):
|
||||||
if review.by_user == user and ('all' in states or review.state in states):
|
if review.by_user == user and ('all' in states or review.state in states):
|
||||||
|
@ -12,6 +12,7 @@ from osclib.core import package_source_hash_history
|
|||||||
from osclib.core import package_version
|
from osclib.core import package_version
|
||||||
from osclib.core import project_attributes_list
|
from osclib.core import project_attributes_list
|
||||||
from osclib.core import project_remote_apiurl
|
from osclib.core import project_remote_apiurl
|
||||||
|
from osclib.core import project_remote_prefixed
|
||||||
from osclib.core import request_action_key
|
from osclib.core import request_action_key
|
||||||
from osclib.core import request_action_list
|
from osclib.core import request_action_list
|
||||||
from osclib.core import request_action_list_source
|
from osclib.core import request_action_list_source
|
||||||
@ -687,7 +688,8 @@ def origin_update_pending(apiurl, origin_project, package, target_project):
|
|||||||
for request, action in sorted(request_actions, key=lambda i: i[0].reqid, reverse=True):
|
for request, action in sorted(request_actions, key=lambda i: i[0].reqid, reverse=True):
|
||||||
identifier = request_remote_identifier(apiurl, apiurl_remote, request.reqid)
|
identifier = request_remote_identifier(apiurl, apiurl_remote, request.reqid)
|
||||||
message = 'Newer pending source available from package origin. See {}.'.format(identifier)
|
message = 'Newer pending source available from package origin. See {}.'.format(identifier)
|
||||||
return request_create_submit(apiurl, action.src_project, action.src_package,
|
src_project = project_remote_prefixed(apiurl, apiurl_remote, action.src_project)
|
||||||
|
return request_create_submit(apiurl, src_project, action.src_package,
|
||||||
target_project, package, message=message, revision=action.src_rev)
|
target_project, package, message=message, revision=action.src_rev)
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
Loading…
x
Reference in New Issue
Block a user