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
1
Merge Requests
1
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
Romain Courteaud
slapos.core
Commits
d678add7
Commit
d678add7
authored
Oct 03, 2012
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Finally use *args, **kwargs in shorthand methods
parent
abd94540
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
9 deletions
+4
-9
slapos/console.py
slapos/console.py
+4
-9
No files found.
slapos/console.py
View file @
d678add7
...
...
@@ -173,15 +173,10 @@ def init(config):
# Create global variable too see available aliases
local
[
'software_list'
]
=
software_list
# Create global shortcut functions to request instance and software
# XXX-Cedric : can we change given parameters to something like
# *args, **kwargs, but without the bad parts, in order to be generic?
def
shorthandRequest
(
software_release
,
partition_reference
,
partition_parameter_kw
=
None
,
software_type
=
None
,
filter_kw
=
None
,
state
=
None
,
shared
=
False
):
return
slap
.
registerOpenOrder
().
request
(
software_release
,
partition_reference
,
partition_parameter_kw
,
software_type
,
filter_kw
,
state
,
shared
)
def
shorthandSupply
(
software_release
,
computer_guid
=
None
,
state
=
'available'
):
return
slap
.
registerSupply
().
supply
(
software_release
,
computer_guid
,
state
)
def
shorthandRequest
(
*
args
,
**
kwargs
):
return
slap
.
registerOpenOrder
().
request
(
*
args
,
**
kwargs
)
def
shorthandSupply
(
*
args
,
**
kwargs
):
return
slap
.
registerSupply
().
supply
(
*
args
,
**
kwargs
)
local
[
'request'
]
=
shorthandRequest
local
[
'supply'
]
=
shorthandSupply
...
...
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