diff --git a/mpcdf_setup_home_project.py b/mpcdf_setup_home_project.py index bfe6fc9b301b36bc1af0d84d2e9c9eac4d570732..23313a3478fd8933103aba87d233babf0ffb1b99 100644 --- a/mpcdf_setup_home_project.py +++ b/mpcdf_setup_home_project.py @@ -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)