Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
theodolite
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sören Henning
theodolite
Commits
e3f96988
Commit
e3f96988
authored
4 years ago
by
Björn Vonheiden
Browse files
Options
Downloads
Patches
Plain Diff
fix problem when no configuration parameters are set
parent
72496237
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
execution/lib/cli_parser.py
+16
-8
16 additions, 8 deletions
execution/lib/cli_parser.py
with
16 additions
and
8 deletions
execution/lib/cli_parser.py
+
16
−
8
View file @
e3f96988
import
argparse
import
os
def
env_list_default
(
env
,
tf
):
"""
Makes a list from an environment string.
...
...
@@ -17,7 +18,7 @@ def key_values_to_dict(kvs):
"""
my_dict
=
{}
for
kv
in
kvs
:
k
,
v
=
kv
.
split
(
"
=
"
)
k
,
v
=
kv
.
split
(
"
=
"
)
my_dict
[
k
]
=
v
return
my_dict
...
...
@@ -29,15 +30,19 @@ def env_dict_default(env):
v
=
os
.
environ
.
get
(
env
)
if
v
is
not
None
:
return
key_values_to_dict
(
v
.
split
(
'
,
'
))
else
:
return
dict
()
class
StoreDictKeyPair
(
argparse
.
Action
):
def
__init__
(
self
,
option_strings
,
dest
,
nargs
=
None
,
**
kwargs
):
self
.
_nargs
=
nargs
super
(
StoreDictKeyPair
,
self
).
__init__
(
option_strings
,
dest
,
nargs
=
nargs
,
**
kwargs
)
def
__call__
(
self
,
parser
,
namespace
,
values
,
option_string
=
None
):
my_dict
=
key_values_to_dict
(
values
)
setattr
(
namespace
,
self
.
dest
,
my_dict
)
def
__init__
(
self
,
option_strings
,
dest
,
nargs
=
None
,
**
kwargs
):
self
.
_nargs
=
nargs
super
(
StoreDictKeyPair
,
self
).
__init__
(
option_strings
,
dest
,
nargs
=
nargs
,
**
kwargs
)
def
__call__
(
self
,
parser
,
namespace
,
values
,
option_string
=
None
):
my_dict
=
key_values_to_dict
(
values
)
setattr
(
namespace
,
self
.
dest
,
my_dict
)
def
default_parser
(
description
):
...
...
@@ -81,7 +86,8 @@ def default_parser(description):
help
=
'
Only resets the environment. Ignores all other parameters
'
)
parser
.
add_argument
(
'
--prometheus
'
,
metavar
=
'
<URL>
'
,
default
=
os
.
environ
.
get
(
'
PROMETHEUS_BASE_URL
'
,
'
http://localhost:9090
'
),
default
=
os
.
environ
.
get
(
'
PROMETHEUS_BASE_URL
'
,
'
http://localhost:9090
'
),
help
=
'
Defines where to find the prometheus instance
'
)
parser
.
add_argument
(
'
--path
'
,
metavar
=
'
<path>
'
,
...
...
@@ -96,6 +102,7 @@ def default_parser(description):
help
=
'
Defines the environment variables for the UC
'
)
return
parser
def
benchmark_parser
(
description
):
"""
Parser for the overall benchmark execution
...
...
@@ -125,6 +132,7 @@ def benchmark_parser(description):
help
=
'
The benchmarking search strategy. Can be set to default, linear-search or binary-search
'
)
return
parser
def
execution_parser
(
description
):
"""
Parser for executing one use case
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment