Finally use *args, **kwargs in shorthand methods

parent abd94540
...@@ -173,15 +173,10 @@ def init(config): ...@@ -173,15 +173,10 @@ def init(config):
# Create global variable too see available aliases # Create global variable too see available aliases
local['software_list'] = software_list local['software_list'] = software_list
# Create global shortcut functions to request instance and software # Create global shortcut functions to request instance and software
# XXX-Cedric : can we change given parameters to something like def shorthandRequest(*args, **kwargs):
# *args, **kwargs, but without the bad parts, in order to be generic? return slap.registerOpenOrder().request(*args, **kwargs)
def shorthandRequest(software_release, partition_reference, def shorthandSupply(*args, **kwargs):
partition_parameter_kw=None, software_type=None, filter_kw=None, return slap.registerSupply().supply(*args, **kwargs)
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)
local['request'] = shorthandRequest local['request'] = shorthandRequest
local['supply'] = shorthandSupply local['supply'] = shorthandSupply
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment