Commit 4a6a1ab3 authored by Lorenz Hüdepohl's avatar Lorenz Hüdepohl
Browse files

More fixes for mpcdf_setup_home_project

parent d1faf1a3
Pipeline #71901 passed with stage
in 15 seconds
......@@ -16,7 +16,9 @@ import osc.cmdln
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")
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]
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)
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