Merge pull request #217 from aplanas/master

Remove the link from the shadow project.
This commit is contained in:
Ludwig Nussel 2014-08-21 16:12:50 +02:00
commit fd519f5251
2 changed files with 12 additions and 5 deletions

View File

@ -23,6 +23,7 @@ import urllib2
from xml.etree import cElementTree as ET
from osc.core import get_binary_file
from osc.core import http_DELETE
from osc.core import http_GET
from osc.core import http_POST
from osc.core import makeurl
@ -884,4 +885,9 @@ class CheckRepo(object):
"""
if request.is_shadow_devel:
self.staging.delete_to_prj(request, request.src_project)
url = self.staging.makeurl(['source', request.shadow_src_project, request.src_package])
http_DELETE(url)
for sub_prj, sub_pkg in self.staging.get_sub_packages(request.src_package,
request.shadow_src_project):
url = self.staging.makeurl(['source', sub_prj, sub_pkg])
http_DELETE(url)

View File

@ -629,13 +629,14 @@ class StagingAPI(object):
return project
def get_sub_packages(self, pkg):
def get_sub_packages(self, pkg, project=None):
"""
Returns a list of packages that need to be linked into rings too. A package is actually
a tuple of project and package name
Returns a list of packages that need to be linked into rings
too. A package is actually a tuple of project and package name
"""
ret = []
project = self.ring_packages.get(pkg)
if not project:
project = self.ring_packages.get(pkg)
if not project:
return ret
url = self.makeurl(['source', project, pkg],