Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpcdf
obs
osc-plugins
Commits
4a6a1ab3
Commit
4a6a1ab3
authored
Apr 01, 2020
by
Lorenz Hüdepohl
Browse files
More fixes for mpcdf_setup_home_project
parent
d1faf1a3
Pipeline
#71901
passed with stage
in 15 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
mpcdf_setup_home_project.py
View file @
4a6a1ab3
...
...
@@ -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
.
start
s
with
(
"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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment