Commit 7bf0f12f authored by Lorenz Huedepohl's avatar Lorenz Huedepohl
Browse files

No more default distribution

parent 662c3384
Pipeline #67059 failed with stage
in 11 seconds
......@@ -147,7 +147,7 @@ def mpcdf_enable_repositories(api_url, project, package, verbose=False):
return True
def mpcdf_setup_repos(api_url, project, distribution, parent=None, packages=None, dry_run=False):
def mpcdf_setup_repos(api_url, project, distribution=None, parent=None, packages=None, dry_run=False):
if parent:
for attribute in ["MPCDF:compiler_modules", "MPCDF:mpi_modules", "MPCDF:cuda_modules"]:
try:
......@@ -160,6 +160,12 @@ def mpcdf_setup_repos(api_url, project, distribution, parent=None, packages=None
mpis = list(get_attribute_values(api_url, project, None, "MPCDF:mpi_modules"))
cudas = list(get_attribute_values(api_url, project, None, "MPCDF:cuda_modules"))
if distribution is None:
# Get existing value from project meta
distribution = project_meta(api_url, project if parent is None else parent).find(
"./repository[@name='System']/path[@project='distributions']").get("repository")
print("Using '{0}' as base distribution".format(distribution))
distributions = project_meta(api_url, "distributions")
dist_repo = distributions.find('./repository[@name="{0}"]'.format(distribution))
if dist_repo is None:
......
......@@ -9,16 +9,12 @@ import osc.conf
import osc.core
import osc.cmdln
default_distribution = "SLE_12_SP1"
@osc.cmdln.option('-n', '--dry-run', action="store_true",
help="Do not actually run anything but output the resulting XML configuration")
@osc.cmdln.option('--parent', metavar="PARENT",
help="Setup the repositories to be based on the upstream project PARENT (e.g. for home: projects)")
@osc.cmdln.option('--distribution',
default=default_distribution,
help="Base distribution [default: %default]")
help="Base distribution, necessary argument unless set previously for this project")
def do_mpcdf_setup_repos(self, subcmd, opts, *args):
"""${cmd_name}: Create all repository combinations for an MPCDF project
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment