Skip to content
Snippets Groups Projects
Commit 4c06a8b3 authored by Lorenz Huedepohl's avatar Lorenz Huedepohl
Browse files

Track list of attributes in one place

parent e9b3b6fd
Branches
No related tags found
No related merge requests found
......@@ -8,6 +8,10 @@ import osc.oscerr
from functools import partial
from xml.etree import ElementTree
package_attributes = ["MPCDF:enable_repositories"]
config_attributes = ["MPCDF:compiler_modules", "MPCDF:cuda_modules", "MPCDF:mpi_modules", "MPCDF:pgi_modules"]
default_attributes = ["MPCDF:default_compiler", "MPCDF:default_cuda", "MPCDF:default_mpi"]
intel_parallel_studio = {
"mpcdf_intel_parallel_studio_2017_7": {"compiler": "intel_17_0_7", "impi": "impi_2017_4", "mkl": "mkl_2017_4-module", },
"mpcdf_intel_parallel_studio_2018_1": {"compiler": "intel_18_0_1", "impi": "impi_2018_1", "mkl": "mkl_2018_1-module", },
......@@ -299,9 +303,9 @@ def mpcdf_enable_repositories(api_url, project, package, verbose=False, filter_r
def mpcdf_setup_repositories(api_url, project, distribution=None, parent=None, packages=None, dry_run=False, filter_repos=None, only_project=False):
if parent:
for attribute in ["compiler_modules", "default_compiler", "mpi_modules", "default_mpi", "cuda_modules", "default_cuda", "pgi_modules"]:
print("Copying attribute 'MPCDF:{0}' from parent project".format(attribute))
set_attribute(api_url, project, None, get_attribute(api_url, parent, None, "MPCDF:" + attribute))
for attribute in config_attributes + default_attributes:
print("Copying attribute '{0}' from parent project".format(attribute))
set_attribute(api_url, project, None, 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"))
......@@ -522,10 +526,7 @@ def sync_projects(api_url, package=None, from_project="software", to_projects=No
else:
from_packages = [package]
project_attributes = ["MPCDF:compiler_modules", "MPCDF:cuda_modules", "MPCDF:mpi_modules"]
package_attributes = ["MPCDF:enable_repositories"] + project_attributes
for attribute in project_attributes:
for attribute in config_attributes:
try:
get_attribute(api_url, to_project, None, attribute)
except Exception:
......@@ -545,7 +546,7 @@ def sync_projects(api_url, package=None, from_project="software", to_projects=No
else:
print("Not branching package {0}, already present in target".format(orig_package))
for attribute in package_attributes:
for attribute in package_attributes + config_attributes:
try:
attr = get_attribute(api_url, from_project, orig_package, attribute)
except UnsetAttributeException:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment