Skip to content
Snippets Groups Projects
Commit 4a6a1ab3 authored by Lorenz Hüdepohl's avatar Lorenz Hüdepohl
Browse files

More fixes for mpcdf_setup_home_project

parent d1faf1a3
No related branches found
No related tags found
No related merge requests found
Pipeline #71901 passed
......@@ -16,7 +16,9 @@ import osc.cmdln
@osc.cmdln.option('--distribution',
help="Base distribution, necessary argument unless set previously for this project")
@osc.cmdln.option('--microarchitecture', metavar="ARCH", nargs=1,
help="Configure project to use ARCH as microarchitecture")
help="Configure project to use ARCH as microarchitecture, "
"defaults to 'sandybridge' or what has been set before in the "
"home project")
@osc.cmdln.alias("mpcdf_setup_home")
def do_mpcdf_setup_home_project(self, subcmd, opts, *args):
"""${cmd_name}: Setup a home project based on a software: sub-project
......@@ -61,14 +63,15 @@ def do_mpcdf_setup_home_project(self, subcmd, opts, *args):
microarchitecture = None
if opts.microarchitecture is None:
for prjconfline in map(decode_it, osc.core.show_project_conf(api_url, project)):
if prjconfline.startwith("Constraint: hostlabel"):
if prjconfline.startswith("Constraint: hostlabel"):
microarchitecture = prjconfline.split()[2]
break
else:
microarchitecture = opts.microarchitecture
if microarchitecture is None:
raise osc.oscerr.WrongArgs('Could not determine desired microarchitecture, please specify --microarchitecture explicitly')
microarchitecture = 'sandybridge'
print("Setting microarchitecture to 'sandybridge' by default")
parent = "software:{0}:{1}".format(distribution, microarchitecture)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment