Skip to content

Commit

Permalink
osclib/stagingapi: get_staging_projects(): utilize project_list_prefi…
Browse files Browse the repository at this point in the history
…x().
  • Loading branch information
jberry-suse committed Feb 6, 2018
1 parent 42e698e commit 378470e
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions osclib/stagingapi.py
Expand Up @@ -49,6 +49,7 @@

from osclib.cache import Cache
from osclib.core import devel_project_get
from osclib.core import project_list_prefix
from osclib.comments import CommentAPI
from osclib.ignore_command import IgnoreCommand
from osclib.memoize import memoize
Expand Down Expand Up @@ -333,17 +334,10 @@ def get_staging_projects(self, include_dvd=True):
:return list of known staging projects
"""

projects = []
projects = project_list_prefix(self.apiurl, self.cstaging)
if not include_dvd:
projects = filter(lambda p: not p.endswith(':DVD'), projects)

query = "id?match=starts-with(@name,'{}:')".format(self.cstaging)
url = self.makeurl(['search', 'project', query])
projxml = http_GET(url)
root = ET.parse(projxml).getroot()
for val in root.findall('project'):
project = val.get('name')
if not include_dvd and project.endswith(':DVD'):
continue
projects.append(project)
return projects

def extract_staging_short(self, p):
Expand Down

0 comments on commit 378470e

Please sign in to comment.