Commit 20f96561 authored by Marco Mariani's avatar Marco Mariani

support for --state argument in request

parent 61077bbe
......@@ -39,7 +39,10 @@ class RequestCommand(ClientConfigCommand):
help="Node request option 'option1=value1 option2=value2'")
ap.add_argument('--type',
help='Define software type to be requested')
help='Software type to be requested')
ap.add_argument('--state',
help='State of the requested instance')
ap.add_argument('--slave',
action='store_true',
......
......@@ -37,6 +37,8 @@ from slapos.slap import ResourceNotReady
class ClientConfig(object):
state = None
def __init__(self, args, configp=None):
# XXX configp cannot possibly be optional
"""
......@@ -115,7 +117,6 @@ def init(conf):
def do_request(conf, local):
# Request instance
print("Requesting %s..." % conf.reference)
if conf.software_url in local:
conf.software_url = local[conf.software_url]
......@@ -126,6 +127,7 @@ def do_request(conf, local):
partition_parameter_kw = conf.parameters,
software_type = conf.type,
filter_kw = conf.node,
state = conf.state,
shared = conf.slave
)
print "Instance requested.\nState is : %s." % partition.getState()
......
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