Commit c2ce75db authored by Lorenz Hüdepohl's avatar Lorenz Hüdepohl

Fix error in mpcdf_enable_repositories

Packages that were completely disabled or enabled only for 'system' were
still branched into all sub-projects.
parent aa71410c
......@@ -92,7 +92,8 @@ def do_mpcdf_enable_repositories(self, subcmd, opts, *args):
if opts.recreate or opts.set or opts.disable:
mpcdf_common.mpcdf_enable_repositories(api_url, project, package, verbose=True, dry_run=opts.dry_run)
if project == "software" and opts.set != "system" and not opts.dry_run:
enabled = mpcdf_common.get_attribute_values(api_url, project, package, "MPCDF:enable_repositories")
if project == "software" and enabled != ["system"] and len(enabled) > 1 and not opts.dry_run:
mpcdf_common.sync_projects(api_url, package, verbose=True)
elif (opts.compiler_modules or opts.mpi_modules or opts.cuda_modules):
......@@ -100,11 +101,11 @@ def do_mpcdf_enable_repositories(self, subcmd, opts, *args):
repos = mpcdf_common.get_attribute_values(api_url, project, package, "MPCDF:enable_repositories")
enabled = mpcdf_common.get_attribute_values(api_url, project, package, "MPCDF:enable_repositories")
except Exception:
repos = ()
enabled = ()
print("ERRROR: No attribute MPCDF:enable_repositories present, package unmanaged")
if repos:
if enabled:
def print_attr(description, attribute_name):
values = mpcdf_common.get_attribute_values(api_url, project, package, attribute_name)
......@@ -112,7 +113,7 @@ def do_mpcdf_enable_repositories(self, subcmd, opts, *args):
print(description, ",".join(values))
print("Enabled for:", ",".join(repos))
print("Enabled for:", ",".join(enabled))
print_attr("- Subset of compiler modules set to:", "MPCDF:compiler_modules")
print_attr("- Subset of MPI modules set to:", "MPCDF:mpi_modules")
print_attr("- Subset of CUDA modules set to:", "MPCDF:cuda_modules")
Markdown is supported
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