Commit ea206d40 authored by Timothy Stack's avatar Timothy Stack

Robot-related improvements based on feedback from Sid:

	* event/sched/event-sched.h, event/sched/event-sched.c,
	event/sched/rpc.h, event/sched/rpc.cc: Send a notification of the
	start of event time and timelines.  Add a '-r' option that forces
	it to use the default rpc path (so dan can use a custom
	scheduler/rmcd/etc on ops).

	* robots/GNUmakefile.in, robots/emc/GNUmakefile.in,
	robots/mtp/GNUmakefile.in, robots/primotion/GNUmakefile.in,
	robots/rmcd/GNUmakefile.in, robots/vmcd/GNUmakefile.in,
	robots/tbsetdest/tbsetdest.cc: Add a control-install target.

	* robots/primotion/garcia-pilot.cc: Take out some experimental
	code.

	* robots/primotion/dashboard.hh, robots/primotion/dashboard.cc,
	robots/primotion/pilotClient.cc, robots/primotion/wheelManager.hh,
	robots/primotion/wheelManager.cc: When doing a COMMAND_STOP, make
	sure we only send one update packet, an idle or an abort.  Also
	send back the actual distance travelled/pivoted.

	* robots/tbsetdest/tbsetdest.cc: Don't output setdest event's with
	a speed of zero.

	* tbsetup/eventsys_control.in: When replaying/stopping, clear the
	start of event time for the experiment.

	* tbsetup/power_mail.pm.in: Decrease the threshold used to tell if
	a node has been power cycled "recently".

	* tbsetup/ns2ir/node.tcl, tbsetup/ns2ir/sim.tcl.in: Bah, backout
	last change, orientation is supposed to be in degrees at these
	points.  Also, when automatically picking the sync server, don't
	use nodes that are subnodes.

	* tmcd/common/bootsubnodes: Send an ISUP for motes.

	* www/moteleds.php3: Show the mote node names instead of the
	robots.

	* www/powertime.php3: Add option to mark nodes as powered off.

	* www/robotmap.php3: Display the elapsed time for the overall
	event time and for each active timeline.

	* www/showexp.php3: Only display the blinky lights menu item when
	there are motes.

	* www/shownode.php3: Change "Update Power Time" -> "Update Power
	State".

	* www/tutorial/mobilewireless.php3: Fix some nits.

	* xmlrpc/emulabserver.py.in: Add event_time_start method for
	storing/getting/clearing the start of event time for an
	experiment/timeline.
parent af0400c1
......@@ -59,6 +59,7 @@ char pideid[BUFSIZ];
char *pid, *eid;
static int get_static_events(event_handle_t handle);
int debug;
const char *XMLRPC_ROOT = TBROOT;
struct lnList agents;
......@@ -100,6 +101,7 @@ usage(void)
" -d Turn on debugging\n"
" -s server Specify location of elvind server. "
"(Default: localhost)\n"
" -r Use the standard RPC path. (Current: %s)\n"
" -p port Specify port number of elvind server\n"
" -l logfile Specify logfile to direct output\n"
" -k keyfile Specify keyfile name\n"
......@@ -107,7 +109,8 @@ usage(void)
"Required arguments:\n"
" pid The project ID of the experiment\n"
" eid The experiment ID\n",
progname);
progname,
TBROOT);
exit(-1);
}
......@@ -137,7 +140,7 @@ main(int argc, char *argv[])
lnNewList(&sequences);
lnNewList(&groups);
while ((c = getopt(argc, argv, "hVs:p:dl:k:")) != -1) {
while ((c = getopt(argc, argv, "hVrs:p:dl:k:")) != -1) {
switch (c) {
case 'h':
usage();
......@@ -149,6 +152,9 @@ main(int argc, char *argv[])
case 'd':
debug++;
break;
case 'r':
XMLRPC_ROOT = "/usr/testbed";
break;
case 's':
server = optarg;
break;
......@@ -382,8 +388,6 @@ main(int argc, char *argv[])
fatal("could not get static event list");
}
RPC_drop();
/* Dequeue events and process them at the appropriate times: */
dequeue(handle);
......@@ -622,7 +626,7 @@ enqueue(event_handle_t handle, event_notification_t notification, void *data)
sched_event_enqueue(event);
return;
}
if (sends_complete(agentp, eventtype))
event.flags |= SEF_SENDS_COMPLETE;
......@@ -663,6 +667,10 @@ handle_event(event_handle_t handle, sched_event_t *se)
error("could not fire event\n");
return;
}
else if (se->flags & SEF_TIME_START) {
RPC_notifystart(pid, eid, "", 1);
RPC_drop();
}
}
/* Dequeue events from the event queue and fire them at the
......@@ -1057,7 +1065,7 @@ get_static_events(event_handle_t handle)
event.time.tv_usec = 0;
event.agent.s = NULL;
event.length = 1;
event.flags = 0;
event.flags = SEF_TIME_START;
timeline_agent_append(ns_sequence, &event);
......@@ -1176,11 +1184,15 @@ handle_completeevent(event_handle_t handle, sched_event_t *eventp)
{
char *value, argsbuf[BUFSIZ] = "";
char objname[TBDB_FLEN_EVOBJNAME];
char objtype[TBDB_FLEN_EVOBJTYPE];
int rc, ctoken = ~0, agerror = 0;
event_notification_get_objname(handle, eventp->notification,
objname, sizeof(objname));
event_notification_get_objtype(handle, eventp->notification,
objtype, sizeof(objtype));
event_notification_get_arguments(handle, eventp->notification,
argsbuf, sizeof(argsbuf));
......@@ -1228,6 +1240,12 @@ handle_completeevent(event_handle_t handle, sched_event_t *eventp)
eventp->agent.s,
ctoken,
agerror);
if (strcmp(objtype, TBDB_OBJECTTYPE_TIMELINE) == 0) {
RPC_grab();
RPC_notifystart(pid, eid, objname, 0);
RPC_drop();
}
return 1;
}
......@@ -44,9 +44,10 @@ struct agent {
};
extern struct lnList agents;
enum {
SEB_COMPLETE_EVENT,
SEB_TIME_START,
SEB_SENDS_COMPLETE,
SEB_SINGLE_HANDLER,
};
......@@ -54,6 +55,7 @@ enum {
enum {
/** Flag for events that are COMPLETEs and should not be forwarded. */
SEF_COMPLETE_EVENT = (1L << SEB_COMPLETE_EVENT),
SEF_TIME_START = (1L << SEB_TIME_START),
/** Flag for events that will send back a COMPLETE. */
SEF_SENDS_COMPLETE = (1L << SEB_SENDS_COMPLETE),
SEF_SINGLE_HANDLER = (1L << SEB_SINGLE_HANDLER),
......
......@@ -8,6 +8,7 @@
#include <sys/param.h>
#include <math.h>
#include <limits.h>
#include <sys/types.h>
#include <assert.h>
......@@ -183,7 +184,7 @@ RPC_invoke(char *method,
va_start(args, tag);
try
{
emulab::ServerProxy proxy(rcp.proto, false, TBROOT);
emulab::ServerProxy proxy(rcp.proto, false, XMLRPC_ROOT);
*er_out = proxy.invoke(method, tag, args);
......@@ -229,7 +230,7 @@ RPC_invoke(char *pid, char *eid, char *method, emulab::EmulabResponse *er)
try
{
emulab::ServerProxy proxy(rcp.proto, false, TBROOT);
emulab::ServerProxy proxy(rcp.proto, false, XMLRPC_ROOT);
*er = proxy.invoke(method,
emulab::SPA_String, "proj", pid,
......@@ -299,6 +300,33 @@ RPC_waitforactive(char *pid, char *eid)
return RPC_invoke(pid, eid, "experiment.waitforactive", &er);
}
int RPC_notifystart(char *pid, char *eid, char *timeline, int set_or_clear)
{
emulab::EmulabResponse er;
double time_start = 0.0;
assert(pid != NULL);
assert(strlen(pid) > 0);
assert(eid != NULL);
assert(strlen(eid) > 0);
assert(timeline != NULL);
if (set_or_clear) {
struct timeval tv;
gettimeofday(&tv, NULL);
time_start = tv.tv_sec + ((double)tv.tv_usec) / 1000000;
}
return RPC_invoke("experiment.event_time_start",
&er,
emulab::SPA_String, "pid", pid,
emulab::SPA_String, "eid", eid,
emulab::SPA_String, "timeline", timeline,
emulab::SPA_Double, "time", time_start,
emulab::SPA_TAG_DONE);
}
static int
RPC_cameralist(FILE *emcd_config, char *area)
{
......@@ -428,7 +456,9 @@ RPC_waitforrobots(event_handle_t handle, char *pid, char *eid)
bldg = loc.getMember("building");
x = ((ulxr::Double)loc.getMember("loc_x")).getDouble();
y = ((ulxr::Double)loc.getMember("loc_y")).getDouble();
orientation = ((ulxr::Double)loc.getMember("orientation")).getDouble();
orientation = ((ulxr::Double)loc.getMember("orientation")).
getDouble();
orientation *= M_PI/ 180.0;
if ((agent = (struct agent *)
lnFindName(&agents, vname)) == NULL) {
error("unknown robot %s\n", vname);
......
......@@ -59,6 +59,7 @@ void RPC_drop(void);
int RPC_exppath(char *pid, char *eid, char *path_out, size_t path_size);
int RPC_waitforrobots(event_handle_t handle, char *pid, char *eid);
int RPC_waitforactive(char *pid, char *eid);
int RPC_notifystart(char *pid, char *eid, char *timeline, int set_or_clear);
int RPC_agentlist(event_handle_t handle, char *pid, char *eid);
int RPC_grouplist(event_handle_t handle, char *pid, char *eid);
int RPC_eventlist(char *pid, char *eid,
......@@ -82,6 +83,7 @@ extern int AddRobot(event_handle_t handle,
double init_y,
double init_orientation);
extern const char *XMLRPC_ROOT;
#ifdef __cplusplus
}
#endif
......
......@@ -12,6 +12,7 @@
#include <assert.h>
#include "rpc.h"
#include "timeline-agent.h"
/**
......@@ -313,6 +314,12 @@ static int timeline_agent_immediate(local_agent_t la, sched_event_t *se)
else if (strcmp(evtype, TBDB_EVENTTYPE_START) == 0) {
struct timeval now, then;
int token, lpc;
if (strcmp(la->la_agent->name, "__ns_timeline") != 0) {
RPC_grab();
RPC_notifystart(pid, eid, la->la_agent->name, 1);
RPC_drop();
}
event_notification_get_int32(la->la_handle,
se->notification,
......
#!/usr/bin/perl -wT
#
# EMULAB-COPYRIGHT
# Copyright (c) 2004 University of Utah and the Flux Group.
# Copyright (c) 2004, 2005 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -313,7 +313,7 @@ MOTE: foreach my $mote (@motes) {
# XXX - We have to reboot stargates after loading the mote. Disgusting,
# there should be some better way
if ($upload_method eq "ssh") {
if (system("$SSHTB -host $host shutdown -r now")) {
if (system("$TB/bin/node_reboot $host")) {
$errors++;
warn "Failed to upload code to $mote";
}
......
......@@ -2,7 +2,7 @@
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2004 University of Utah and the Flux Group.
# Copyright (c) 2000-2005 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -162,6 +162,14 @@ if ($action eq "start" && !$force && !ExpNodes($pid, $eid)) {
exit(0);
}
#
# Delete the TIME START event.
#
if ($action eq "replay" || $action eq "stop") {
DBQueryFatal("DELETE FROM eventlist WHERE " .
"pid='$pid' and eid='$eid' and objecttype=3 and eventtype=1");
}
# Need the unix_gid info to pass to boss.
my $gid = ExpGroup($pid, $eid);
my ($unix_gid, $unix_gidname);
......
......@@ -250,10 +250,9 @@ Node instproc updatedb {DB} {
return
}
set o [expr $orientation_ * 3.14159 / 180.0]
$sim spitxml_data "virt_node_startloc" \
[list "vname" "building" "floor" "loc_x" "loc_y" "orientation"] \
[list $self [$topo set area_name] "" $X_ $Y_ $o]
[list $self [$topo set area_name] "" $X_ $Y_ $orientation_]
}
# Put in the desires, too
......
......@@ -472,7 +472,7 @@ Simulator instproc run {} {
foreach node [lsort [array names node_list]] {
$node updatedb "sql"
if { $default_sync_server == {} } {
if { $default_sync_server == {} && ![$node set issubnode] } {
set default_sync_server $node
}
}
......@@ -1177,8 +1177,7 @@ Simulator instproc make_event {outer event} {
::GLOBALS::named-args [lrange $evargs 3 end] {
-orientation 0
}
set o [expr $(-orientation) * 3.14159 / 180.0]
set args "X=$x Y=$y SPEED=$speed ORIENTATION=$o"
set args "X=$x Y=$y SPEED=$speed ORIENTATION=$(-orientation)"
}
unknown {
punsup "$obj $cmd $evargs"
......
......@@ -21,6 +21,7 @@ use libtestbed;
my $WWW = "@WWW@";
my $TBOPS = "@TBOPSEMAIL@";
my $default_tries = 10;
my $time_tolerance = 250;
# Turn off line buffering on output
$| = 1;
......@@ -40,7 +41,7 @@ sub mailctrl($@) {
foreach my $node (@nodes) {
my $dbres = DBQueryFatal(
"select (CURRENT_TIMESTAMP - last_power) < 500 " .
"select (CURRENT_TIMESTAMP - last_power) < $time_tolerance " .
"from outlets where node_id='$node'");
if ($dbres->num_rows() == 0) {
......@@ -74,7 +75,7 @@ sub mailctrl($@) {
while (!$ok) {
my $dbres = DBQueryFatal(
"select (CURRENT_TIMESTAMP - last_power) < 500 " .
"select (CURRENT_TIMESTAMP - last_power) < $time_tolerance " .
"from outlets where node_id='$node'");
if ($dbres->num_rows() == 0) {
......
......@@ -123,6 +123,9 @@ foreach my $subnode (keys(%subnodelist)) {
last SWITCH;
};
/^mote$/i && do {
libsetup_setvnodeid($subnode);
configtmcc("subnode", $subnode);
tmcc(TMCCCMD_STATE, "ISUP");
last SWITCH;
};
print "Invalid subnode type: $type\n";
......
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2004 University of Utah and the Flux Group.
# Copyright (c) 2004, 2005 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -52,29 +52,24 @@ if (! TBExptAccessCheck($uid, $pid, $eid, $TB_EXPT_READINFO)) {
# Get a list of all nodes in this experiment of type 'garcia' or 'stargate'
#
$query_result =
DBQueryFatal("select r.vname, r.node_id,t.type,t.class from reserved as r ".
"left join nodes as n on ".
" r.node_id=n.node_id ".
"left join node_types as t on ".
" n.type=t.type ".
"where r.pid='$pid' and r.eid='$eid' ".
"order by r.vname");
DBQueryFatal("select r.vname,n.phys_nodeid ".
"from reserved as r ".
"left join nodes as n on r.node_id=n.node_id ".
"left join node_types as t on n.type=t.type ".
"where r.pid='$pid' and r.eid='$eid' and t.class='mote' ".
"order by r.vname");
if (mysql_num_rows($query_result) == 0) {
echo "<h3>No nodes to display in this experiment!</h3>\n";
} else {
echo "<table align=center cellpadding=2 border=1>
<tr><th>Mote</th><th>Phys Name</th><th>LEDs</th>\n";
while ($row = mysql_fetch_array($query_result)) {
if ($row['type'] != "garcia" && $row['class'] != "sg") {
# Only the LEDs, mam
continue;
}
echo "<tr><th>$row[vname]</th>";
echo "<td>$row[node_id]</td><td>";
echo "<td>$row[phys_nodeid]</td><td>";
SHOWBLINKENLICHTEN($uid,
$HTTP_COOKIE_VARS[$TBAUTHCOOKIE],
"ledpipe.php3?node=$row[node_id]");
$HTTP_COOKIE_VARS[$TBAUTHCOOKIE],
"ledpipe.php3?node=$row[phys_nodeid]");
}
echo "</table>\n";
......
......@@ -36,11 +36,19 @@ if ($confirmed) {
if (!TBValidNodeName($ni)) {
USERERROR("Invalid node ID: $ni", 1);
}
DBQueryFatal("update outlets " .
"set last_power=CURRENT_TIMESTAMP " .
"where node_id='$ni'");
$body_str .= "<b>$ni</b><br>";
if (isset($poweron) && $poweron == "Yep") {
DBQueryFatal("update outlets " .
"set last_power=CURRENT_TIMESTAMP " .
"where node_id='$ni'");
}
if (!isset($poweron) || $poweron != "Yep") {
DBQueryFatal("update nodes " .
"set eventstate='POWEROFF'," .
"state_timestamp=unix_timestamp(NOW()) " .
"where node_id='$ni'");
}
$body_str .= "<b>$ni</b> $poweron<br>";
}
}
else {
......@@ -67,7 +75,8 @@ else {
</tr>";
}
$body_str .= "</table><br>";
$body_str .= "<input type=submit name=confirmed value=Confirm></form>";
$body_str .= "<input type=checkbox name=poweron value=Yep checked>Power On";
$body_str .= "<br><input type=submit name=confirmed value=Confirm></form>";
}
$body_str .= "</center>";
......
......@@ -117,7 +117,7 @@ $locations = array();
$vnames = array();
$query_result =
DBQueryFatal("select loc.*,r.vname from location_info as loc ".
DBQueryFatal("select loc.*,r.vname,r.pid,r.eid from location_info as loc ".
"left join reserved as r on r.node_id=loc.node_id ".
"where loc.floor='$floor' and loc.building='$building'");
......@@ -127,12 +127,15 @@ while ($row = mysql_fetch_array($query_result)) {
$loc_y = $row["loc_y"];
$orient = $row["orientation"];
if (isset($pid) && isset($row["vname"]))
if ((isset($pid) && $pid == $row["pid"]) &&
(isset($eid) && $eid == $row["eid"]) &&
isset($row["vname"])) {
$vnames[$node_id] = $row["vname"];
}
if (isset($pixels_per_meter) && $pixels_per_meter) {
$meters_x = sprintf("%.3f", $loc_x / $pixels_per_meter);
$meters_y = sprintf("%.3f", $loc_y / $pixels_per_meter);
$meters_x = sprintf("%.2f", $loc_x / $pixels_per_meter);
$meters_y = sprintf("%.2f", $loc_y / $pixels_per_meter);
$locations[$node_id] = "x=$meters_x, y=$meters_y meters";
}
......@@ -144,6 +147,19 @@ while ($row = mysql_fetch_array($query_result)) {
}
}
$event_time_start = array();
if (isset($pid) && isset($eid)) {
$query_result =
DBQueryFatal("SELECT parent,arguments FROM eventlist WHERE " .
"pid='$pid' and eid='$eid' and objecttype=3 and ".
"eventtype=1 ORDER BY parent");
if (mysql_num_rows($query_result)) {
while ($row = mysql_fetch_array($query_result)) {
$event_time_start[$row["parent"]] = $row["arguments"];
}
}
}
#
# Run the Perl script. It will produce three output files; image, areamap,
# and state. We want to embed all of these images into the page we
......@@ -221,14 +237,10 @@ echo "<center>\n";
# Wrap the image and zoom controls together in an input form.
echo "<form method=\"post\" action=\"robotmap.php3\">\n";
echo "Click on the image to get its X,Y coordinates<br>\n";
# The image may be clicked to get node info or set a new center-point.
echo " Click on the dots below to see information about the robot\n";
echo " <br>\n";
echo " Click elsewhere to get its x,y location.\n";
echo " <br>\n";
if ($isadmin || TBWebCamAllowed($uid)) {
echo " There is a nifty <a href=webcam.php3>webcam image</a> of the";
echo " robots too\n";
echo " <a href=webcam.php3>Webcam View</a> (Updated every five seconds)";
echo " <br>\n";
}
......@@ -239,7 +251,7 @@ if (isset($map_x) && isset($map_y)) {
$meters_x = sprintf("%.3f", $map_x / $pixels_per_meter);
$meters_y = sprintf("%.3f", $map_y / $pixels_per_meter);
echo "Last click location was x=$meters_x, y=$meters_y meters.\n";
echo "Last click location was x=<b>$meters_x</b>, y=<b>$meters_y</b> meters.\n";
}
else {
echo "Last click location was x=$map_x, y=$map_y pixels\n";
......@@ -247,6 +259,26 @@ if (isset($map_x) && isset($map_y)) {
echo "<br>\n";
}
if (isset($pid) && isset($eid)) {
$current_time = time();
foreach ($event_time_start as $key => $value) {
$event_time_elapsed = $current_time - $value;
if ($key == "") {
echo "Elapsed event time: ";
}
else {
echo "Elapsed time for timeline '$key': ";
}
$minutes = floor($event_time_elapsed / 60);
$seconds = $event_time_elapsed % 60;
echo "<b>" . $minutes . "m " . $seconds . "s </b>(<b>" .
sprintf("%.1f", $event_time_elapsed) . "s</b>)<br>";
}
if (empty($event_time_start)) {
echo "<i><b>Elapsed event time: Not started yet</b></i>";
}
}
echo " <input name=map type=image style=\"border: 2px solid\" ";
echo "src=\"floormap_aux.php3?prefix=$uniqueid\" ".
"usemap=\"#floormap\">\n";
......@@ -277,7 +309,8 @@ echo "<td align=\"left\" valign=\"top\" class=\"stealth\">
<tr><th colspan=2>Legend</th></tr>
<tr>
<td><img src=\"floormap/map_legend_node.gif\"></td>
<td>Robot Actual Position</td>
<td>Robot Actual Position<br>
<font size=\"-1\">(Click dots for more information)</font></td>
</tr>
<tr>
<td><img src=\"floormap/map_legend_node_dst.gif\"></td>
......@@ -328,13 +361,17 @@ echo "<td align=\"left\" valign=\"top\" class=\"stealth\">
<td><input type=checkbox
name=\"formfields[show_cameras]\"
value=Yep
$cam_checked>Show Camera Bounds</input></td>
$cam_checked>Show <a
href=\"doc/docwrapper.php3?docname=mobilewireless.html#VISION\">Tracking
Camera</a> Bounds</input></td>
</tr>
<tr>
<td><input type=checkbox
name=\"formfields[show_exclusion]\"
value=Yep
$excl_checked>Show Exclusion Zones</input></td>
$excl_checked>Show <a
href=\"doc/docwrapper.php3?docname=mobilewireless.html#VISION\">Exclusion
Zones</a></input></td>
</tr>
<tr><td colspan=2 align=center><input type=submit value=Update></td></tr>
</table>
......
......@@ -231,7 +231,7 @@ if ($types['garcia']) {
# Blinky lights - but only if they have nodes of the correct type in their
# experiment
if ($types['garcia'] || $classes['sg']) {
if ($classes['mote']) {
WRITESUBMENUBUTTON("Show Blinky Lights",
"moteleds.php3?pid=$exp_pid&eid=$exp_eid","moteleds");
}
......
......@@ -137,8 +137,8 @@ if ($isadmin) {
"freenode.php3?node_id=$node_id");
WRITESUBMENUBUTTON("Set Node Location",
"setnodeloc.php3?node_id=$node_id");
WRITESUBMENUBUTTON("Update Power Time",
"power.php3?node_id=$node_id");
WRITESUBMENUBUTTON("Update Power State",
"powertime.php3?node_id=$node_id");
}
SUBMENUEND();
......
This diff is collapsed.
......@@ -2683,6 +2683,72 @@ class experiment:
pass
return EmulabResponse(RESPONSE_SUCCESS, value=result)
def event_time_start(self, version, argdict):
if version != self.VERSION:
return EmulabResponse(RESPONSE_BADVERSION,
output="Client version mismatch!")
argerror = CheckRequiredArgs(argdict, ("proj", "exp"))
if (argerror):
return argerror
if not (re.match("^[-\w]*$", argdict["proj"]) and
re.match("^[-\w]*$", argdict["exp"])):
return EmulabResponse(RESPONSE_BADARGS,
output="Improperly formed proj/exp!")
tl_clause = ""
tl_insert = ""
if argdict.has_key("timeline"):
if not re.match("^[-\w]*$", argdict["timeline"]):
return EmulabResponse(RESPONSE_BADARGS,
output="Improperly formed timeline!")
else:
tl_clause = " and parent='%s'" % (argdict["timeline"],)
tl_insert = ",parent='%s'" % (argdict["timeline"],)
pass
pass
#
# Check permission.
#
permerror = CheckExptPermission(self.uid,
argdict["proj"], argdict["exp"])
if (permerror):
return permerror
if argdict.has_key("time"):
value = float(argdict["time"])
# XXX remove hardcoded event/object types.
DBQueryFatal("DELETE FROM eventlist WHERE "
"pid=%s and eid=%s and objecttype=3 and eventtype=1"
+ tl_clause,
(argdict["proj"], argdict["exp"]))
if value > 0:
DBQueryFatal("INSERT INTO eventlist SET "
"pid=%s,eid=%s,objecttype=3,eventtype=1,"
"arguments=%s" + tl_insert,
(argdict["proj"], argdict["exp"], value))
pass
result = "ok"
pass
else:
result = DBQueryFatal("SELECT parent,arguments FROM eventlist "
"WHERE pid=%s and eid=%s and objecttype=3 "
"and eventtype=1",
(argdict["proj"], argdict["exp"]),
True)
if len(result) == 0:
return EmulabResponse(RESPONSE_ERROR,
output="Event time has not started yet")
pass
return EmulabResponse(RESPONSE_SUCCESS, output=`result`, value=result)
pass
......
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