Commit a81925a3 authored by David Johnson's avatar David Johnson

Expose node.getlist method via script_wrapper.py .

parent 4c08dcee
......@@ -35,7 +35,7 @@ SYMLINKS = node_admin node_reboot os_load create_image node_list \
modexp expinfo node_avail tbuisp expwait template_commit \
template_export template_swapin template_swapout \
template_stoprun template_instantiate template_startrun \
template_checkout
template_checkout node_avail_list
#
# Force dependencies on the scripts so that they will be rerun through
......
......@@ -92,6 +92,9 @@ API = {
"in an experiment" },
"node_avail" : { "func" : "node_avail",
"help" : "Print free node counts" },
"node_avail_list" : { "func" : "node_avail_list",
"help" : "Print physical node_ids for matching" +
"free nodes" },
"delay_config" : { "func" : "delay_config",
"help" : "Change the link shaping characteristics " +
"for a link or lan" },
......@@ -654,6 +657,65 @@ class node_avail:
pass
#
# node_avail_list
#
class node_avail_list:
def __init__(self, argv=None):
self.argv = argv;
return
def apply(self):
params = {}
try:
opts, req_args = getopt.getopt(self.argv, "hp:t:c:n:", [
"help", "project=", "node-type=", "node-class=", "nodes=" ])
for opt, val in opts:
if opt in ("-h", "--help"):
self.usage();
return 0
elif opt in ("-p", "--project"):
params["proj"] = val
pass
elif opt in ("-c", "--node-class"):
params["class"] = val
pass
elif opt in ("-t", "--node-type"):
params["type"] = val
pass
elif opt in ("-n", "--nodes"):
params["nodes"] = val
pass
pass
pass
except getopt.error, e:
print e.args[0]
self.usage();
return -1;
rval,response = do_method("node", "getlist", params)
return rval
def usage(self):
print "node_avail_list [-p project] [-c class] [-t type] [-n nodes]"
print "Print physical node_ids of available nodes."
print "where:"
print " -p project - Specify project credentials for node"
print " types that are restricted"
print " -c class - The node class (Default: pc)"
print " -t type - The node type"
print " -n pcX,pcY,...,pcZ - A list of physical node_ids"
print
print "example:"
print " $ node_avail_list -t pc850"
wrapperoptions()
return
pass
#
# delay_config
#
......
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