Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Léo-Paul Géneau
slapos.core
Commits
047185fc
Commit
047185fc
authored
2 years ago
by
Joanne Hugé
Browse files
Options
Download
Email Patches
Plain Diff
console: add getparams method in globals
parent
b72c0fc2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletion
+9
-1
slapos/cli/console.py
slapos/cli/console.py
+6
-1
slapos/client.py
slapos/client.py
+3
-0
No files found.
slapos/cli/console.py
View file @
047185fc
...
...
@@ -27,6 +27,7 @@
#
##############################################################################
import
sys
import
textwrap
from
slapos.cli.config
import
ClientConfigCommand
...
...
@@ -81,7 +82,10 @@ class ConsoleCommand(ClientConfigCommand):
action
=
'store_true'
,
help
=
'Use plain Python shell'
)
shell
.
add_argument
(
'script_file'
,
nargs
=
'?'
,
ap
.
add_argument
(
'--console_args'
,
nargs
=
'+'
,
help
=
'Console args'
)
shell
.
add_argument
(
'--script_file'
,
nargs
=
'?'
,
help
=
'Script to run'
)
return
ap
...
...
@@ -95,6 +99,7 @@ class ConsoleCommand(ClientConfigCommand):
with
open
(
args
.
script_file
)
as
f
:
code
=
compile
(
f
.
read
(),
args
.
script_file
,
'exec'
)
local
[
'__file__'
]
=
args
.
script_file
sys
.
argv
=
[
args
.
script_file
]
+
args
.
console_args
return
exec_
(
code
,
local
,
local
)
if
not
any
([
args
.
python
,
args
.
ipython
,
args
.
bpython
]):
...
...
This diff is collapsed.
Click to expand it.
slapos/client.py
View file @
047185fc
...
...
@@ -101,8 +101,11 @@ def init(conf, logger):
def
shorthandSupply
(
*
args
,
**
kwargs
):
# XXX-Cedric Implement computer_group support
return
slap
.
registerSupply
().
supply
(
*
args
,
**
kwargs
)
def
getParams
(
*
args
,
**
kwargs
):
return
slap
.
registerOpenOrder
().
getInformation
(
*
args
,
**
kwargs
)
local
[
'request'
]
=
shorthandRequest
local
[
'supply'
]
=
shorthandSupply
local
[
'getparams'
]
=
getParams
local
[
'product'
]
=
SoftwareProductCollection
(
logger
,
slap
)
return
local
...
...
This diff is collapsed.
Click to expand it.
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