Merge pull request #5 from scarabeusiv/master

Merging simple polishing
This commit is contained in:
Michal Hrušecký 2014-02-10 10:54:16 +01:00
commit ad34fbdd34

View File

@ -24,6 +24,8 @@ def _print_version(self):
def list_staging_projects(apiurl): def list_staging_projects(apiurl):
""" """
List all current running staging projects List all current running staging projects
:param apiurl: url to the OBS api
:return list of known staging projects
""" """
projects = [] projects = []
@ -39,8 +41,10 @@ def list_staging_projects(apiurl):
def _get_parent(apirul, project, repo = "standard"): def _get_parent(apirul, project, repo = "standard"):
""" """
Finds what is the parent project of the staging project Finds what is the parent project of the staging project
:param apiurl: url to the OBS api
:param project: staging project to check :param project: staging project to check
:param repo: which repository to follow :param repo: which repository to follow
:return name of the parent project
""" """
url = make_meta_url("prj", project, apiurl) url = make_meta_url("prj", project, apiurl)
@ -56,6 +60,7 @@ def _get_parent(apirul, project, repo = "standard"):
def _pseudometa_get_prj(apiurl, project): def _pseudometa_get_prj(apiurl, project):
""" """
Gets project data from YAML in project description Gets project data from YAML in project description
:param apiurl: url to the OBS api
:param project: project to read data from :param project: project to read data from
:return structured object with metadata :return structured object with metadata
""" """
@ -69,12 +74,13 @@ def _pseudometa_get_prj(apiurl, project):
try: try:
data = yaml.load(description.text) data = yaml.load(description.text)
except: except:
data = yaml.load('requests: []') data = yaml.load('requests: []')
return data return data
def _pseudometa_set_prj(apiurl, project, meta): def _pseudometa_set_prj(apiurl, project, meta):
""" """
Sets project description to the YAML of the provided object Sets project description to the YAML of the provided object
:param apiurl: url to the OBS api
:param project: project to save into :param project: project to save into
:param meta: data to save :param meta: data to save
""" """
@ -95,6 +101,7 @@ def _pseudometa_set_prj(apiurl, project, meta):
def _pseudometa_add_rq_to_prj(apiurl, project, request_id, package): def _pseudometa_add_rq_to_prj(apiurl, project, request_id, package):
""" """
Records request as part of the project within metadata Records request as part of the project within metadata
:param apiurl: url to the OBS api
:param project: project to record into :param project: project to record into
:param request_id: request id to record :param request_id: request id to record
:param package: package the request is about :param package: package the request is about
@ -107,6 +114,7 @@ def _pseudometa_add_rq_to_prj(apiurl, project, request_id, package):
def sr_to_prj(apiurl, request_id, project): def sr_to_prj(apiurl, request_id, project):
""" """
Links sources from request to project Links sources from request to project
:param apiurl: url to the OBS api
:param request_id: request to link :param request_id: request to link
:param project: project to link into :param project: project to link into
""" """