Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xavier Thompson
slapos.core
Commits
1408f0c6
Commit
1408f0c6
authored
Dec 08, 2021
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cli/request: Add --parameters-file option
parent
a244d797
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
slapos/cli/request.py
slapos/cli/request.py
+12
-2
No files found.
slapos/cli/request.py
View file @
1408f0c6
...
@@ -27,6 +27,7 @@
...
@@ -27,6 +27,7 @@
#
#
##############################################################################
##############################################################################
import
json
import
pprint
import
pprint
from
slapos.cli.config
import
ClientConfigCommand
from
slapos.cli.config
import
ClientConfigCommand
...
@@ -78,7 +79,12 @@ class RequestCommand(ClientConfigCommand):
...
@@ -78,7 +79,12 @@ class RequestCommand(ClientConfigCommand):
action
=
'store_true'
,
action
=
'store_true'
,
help
=
'Ask for a slave instance'
)
help
=
'Ask for a slave instance'
)
ap
.
add_argument
(
'--parameters'
,
parameter_args
=
parser
.
add_mutually_exclusive_group
()
parameter_args
.
add_argument
(
'--parameters-file'
,
help
=
"Give a configuration file in JSON format"
)
parameter_args
.
add_argument
(
'--parameters'
,
nargs
=
'+'
,
nargs
=
'+'
,
help
=
"Give your configuration 'option1=value1 option2=value2'"
)
help
=
"Give your configuration 'option1=value1 option2=value2'"
)
...
@@ -86,6 +92,10 @@ class RequestCommand(ClientConfigCommand):
...
@@ -86,6 +92,10 @@ class RequestCommand(ClientConfigCommand):
def
take_action
(
self
,
args
):
def
take_action
(
self
,
args
):
args
.
node
=
parse_option_dict
(
args
.
node
)
args
.
node
=
parse_option_dict
(
args
.
node
)
if
args
.
parameters_file
:
with
open
(
args
.
parameters_file
)
as
f
:
args
.
parameters
=
json
.
load
(
f
)
else
:
args
.
parameters
=
parse_option_dict
(
args
.
parameters
)
args
.
parameters
=
parse_option_dict
(
args
.
parameters
)
configp
=
self
.
fetch_config
(
args
)
configp
=
self
.
fetch_config
(
args
)
...
...
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