Allow submitting optional parameters such as copr_owner and copr_project

This commit is contained in:
Jakub Kadlčík
2017-02-21 14:30:47 +01:00
parent 8b83e78394
commit 92dce63091
4 changed files with 50 additions and 10 deletions

View File

@@ -526,17 +526,17 @@ def record_component_builds(scm, mmd, module, initial_batch = 1):
return batch
def submit_module_build_from_yaml(username, yaml):
def submit_module_build_from_yaml(username, yaml, optional_params={}):
mmd = load_mmd(yaml)
return submit_module_build(username, None, mmd, None, yaml)
return submit_module_build(username, None, mmd, None, yaml, optional_params)
def submit_module_build_from_scm(username, url, allow_local_url=False):
def submit_module_build_from_scm(username, url, allow_local_url=False, optional_params={}):
mmd, scm, yaml = _fetch_mmd(url, allow_local_url)
return submit_module_build(username, url, mmd, scm, yaml)
return submit_module_build(username, url, mmd, scm, yaml, optional_params)
def submit_module_build(username, url, mmd, scm, yaml):
def submit_module_build(username, url, mmd, scm, yaml, optional_params={}):
# Import it here, because SCM uses utils methods
# and fails to import them because of dep-chain.
import module_build_service.scm
@@ -569,7 +569,8 @@ def submit_module_build(username, url, mmd, scm, yaml):
version=str(mmd.version),
modulemd=yaml,
scmurl=url,
username=username
username=username,
**optional_params
)
record_component_builds(scm, mmd, module)