Commit 5f1bda7a authored by Lorenz Huedepohl's avatar Lorenz Huedepohl
Browse files

Rename mpcdf_setup_repos to mpcdf_setup_repositories

An alias is in place to also provide the old name
parent 6584c0eb
from __future__ import print_function
__all__ = ["valid_mpi", "valid_cuda", "project_meta", "get_attribute", "get_attribute_values", "set_attribute", "mpcdf_enable_repositories", "mpcdf_setup_repos"]
__all__ = ["valid_mpi", "valid_cuda", "project_meta", "get_attribute", "get_attribute_values", "set_attribute", "mpcdf_enable_repositories", "mpcdf_setup_repositories"]
import osc
import osc.conf
......@@ -147,14 +147,11 @@ def mpcdf_enable_repositories(api_url, project, package, verbose=False):
return True
def mpcdf_setup_repos(api_url, project, distribution=None, parent=None, packages=None, dry_run=False):
def mpcdf_setup_repositories(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:
get_attribute_values(api_url, project, None, attribute)
except Exception:
print("Copying attribute '{0}' from parent project".format(attribute))
set_attribute(api_url, (project,), get_attribute(api_url, parent, None, attribute))
print("Copying attribute '{0}' from parent project".format(attribute))
set_attribute(api_url, (project,), get_attribute(api_url, parent, None, attribute))
compilers = list(get_attribute_values(api_url, project, None, "MPCDF:compiler_modules"))
mpis = list(get_attribute_values(api_url, project, None, "MPCDF:mpi_modules"))
......
#!/usr/bin/python2
from __future__ import print_function
from mpcdf_common import mpcdf_setup_repos
from mpcdf_common import mpcdf_setup_repositories
import os
import osc
......@@ -16,7 +16,8 @@ import osc.cmdln
help="Setup the repositories to be based on the upstream project PARENT (e.g. for home: projects)")
@osc.cmdln.option('--distribution',
help="Base distribution, necessary argument unless set previously for this project")
def do_mpcdf_setup_repos(self, subcmd, opts, *args):
@osc.cmdln.alias("mpcdf_setup_repos")
def do_mpcdf_setup_repositories(self, subcmd, opts, *args):
"""${cmd_name}: Create all repository combinations for an MPCDF project
Given a list of compilers, MPI libraries, and possibly CUDA versions, this command
......@@ -40,4 +41,4 @@ def do_mpcdf_setup_repos(self, subcmd, opts, *args):
else:
raise osc.oscerr.WrongArgs("Too many arguments")
mpcdf_setup_repos(self.get_api_url(), project, opts.distribution, parent=opts.parent, dry_run=opts.dry_run)
mpcdf_setup_repositories(self.get_api_url(), project, opts.distribution, parent=opts.parent, dry_run=opts.dry_run)
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