Commit f456c91f authored by Robert Ricci's avatar Robert Ricci

Revert my last set of checkins.

This is ridiculously hard to do with CVS.
parent f0d489e8
......@@ -2465,9 +2465,8 @@ foreach my $vnode (keys(%v2pmap)) {
printdb("sshdport: $vnode $pnode $vvnode $sshdport\n");
DBQueryFatal("replace into port_registration set pid='$pid', " .
"eid='$eid', exptidx='$experiment_idx', service='sshd', ".
"node_id='$vvnode', port=$sshdport");
DBQueryFatal("update nodes set sshdport=$sshdport ".
"where node_id='$vvnode'");
}
}
......
......@@ -856,19 +856,13 @@ class Plab:
" (node_id, type, phys_nodeid, role, priority,"
" op_mode, def_boot_osid, update_accounts,"
" allocstate, allocstate_timestamp,"
" eventstate, state_timestamp)"
" eventstate, state_timestamp, sshdport)"
" values (%s, %s, %s, %s, %s,"
" %s, %s, %s, %s, now(), %s, now(), %s)",
(vnodeid, vnodetype, nodeid, 'virtnode', vprio,
'PCVM', defosid, 1,
'FREE_CLEAN',
'SHUTDOWN'))
DBQueryFatal("insert into port_registration"
" (pid, eid, exptidx, service, node_id, port)"
" values (%s, %s, %s, %s, %s, %s)",
(MONITOR_PID, MONITOR_EID, mon_exptidx,
'sshd', vnodeid, sshdport ))
'SHUTDOWN', sshdport))
DBQueryFatal("insert into node_hostkeys"
" (node_id)"
......
......@@ -162,14 +162,12 @@ print "\n";
if ($state eq EXPTSTATE_ACTIVE) {
my $query_result =
DBQueryFatal("select r.vname,r.node_id,n.type,n.phys_nodeid,o.osname,".
" p.port,n.jailflag,nt.isremotenode,".
" n.sshdport,n.jailflag,nt.isremotenode,".
" nt.isplabdslice ".
" from reserved as r ".
"left join nodes as n on r.node_id=n.node_id ".
"left join os_info as o on o.osid=n.def_boot_osid ".
"left join node_types as nt on nt.type=n.type ".
"left join port_registration as p on ".
" (n.node_id = p.node_id and p.service='sshd')".
"where r.pid='$pid' and r.eid='$eid' order by vname");
while (($v,$p,$t,$m,$o,$s,$j,$r,$d) = $query_result->fetchrow_array()) {
......
......@@ -4915,10 +4915,8 @@ COMMAND_PROTOTYPE(dojailconfig)
/*
* Now need the sshdport and jailip for this node.
*/
res = mydb_query("select port, jailip from nodes as n "
"left join port_registration as p on "
" (n.node_id = p.node_id and p.service='sshd') "
"where node_id='%s'",
res = mydb_query("select sshdport,jailip from nodes "
"where node_id='%s'",
2, reqp->nodeid);
if (!res) {
......@@ -5033,7 +5031,7 @@ COMMAND_PROTOTYPE(doplabconfig)
/*
* Now need the sshdport for this node.
*/
res = mydb_query("select p.port, ps.admin, i.IP "
res = mydb_query("select n.sshdport, ps.admin, i.IP "
" from reserved as r "
" left join nodes as n "
" on n.node_id=r.node_id "
......@@ -5041,8 +5039,6 @@ COMMAND_PROTOTYPE(doplabconfig)
" on n.phys_nodeid=i.node_id "
" left join plab_slices as ps "
" on r.pid=ps.pid and r.eid=ps.eid "
" left join port_registration as p on "
" (n.node_id = p.node_id and p.service='sshd') "
" where i.role='ctrl' and r.node_id='%s'",
3, reqp->nodeid);
......@@ -7200,7 +7196,7 @@ COMMAND_PROTOTYPE(domotelog)
}
/*
* Lookup or record the port number that is being used for a particular service
* Return motelog info for this node.
*/
COMMAND_PROTOTYPE(doportregister)
{
......
......@@ -403,7 +403,7 @@ class Node
"last_ext_act) as last_act, ".
" t.isvirtnode,t.isremotenode,t.isplabdslice, ".
" r.erole as rsrvrole, pi.IP as phys_IP, loc.*, ".
" util.*, p.port ".
" util.* ".
" from nodes as n ".
"left join reserved as r on n.node_id=r.node_id ".
"left join node_activity as na on ".
......@@ -419,8 +419,6 @@ class Node
" loc.node_id=n.node_id ".
"left join node_utilization as util on ".
" util.node_id=n.node_id ".
"left join port_registration as p on ".
" (n.node_id = p.node_id and p.service='sshd') ".
"where n.node_id='$node_id'");
if (mysql_num_rows($query_result) == 0) {
......@@ -456,7 +454,7 @@ class Node
$ipport_low = $row["ipport_low"];
$ipport_next = $row["ipport_next"];
$ipport_high = $row["ipport_high"];
$sshdport = $row["port"];
$sshdport = $row["sshdport"];
$last_act = $row["last_act"];
$last_tty_act = $row["last_tty_act"];
$last_net_act = $row["last_net_act"];
......
......@@ -43,14 +43,12 @@ else {
}
$query_result =
DBQueryFatal("select n.jailflag,n.jailip,p.port, ".
DBQueryFatal("select n.jailflag,n.jailip,n.sshdport, ".
" r.vname,r.pid,r.eid, ".
" t.isvirtnode,t.isremotenode,t.isplabdslice ".
" from nodes as n ".
"left join reserved as r on n.node_id=r.node_id ".
"left join node_types as t on t.type=n.type ".
"left join port_registration as p on ".
" (n.node_id = p.node_id and p.service='sshd') ".
"where n.node_id='$node_id'");
if (mysql_num_rows($query_result) == 0) {
......@@ -60,7 +58,7 @@ if (mysql_num_rows($query_result) == 0) {
$row = mysql_fetch_array($query_result);
$jailflag = $row["jailflag"];
$jailip = $row["jailip"];
$sshdport = $row["port"];
$sshdport = $row["sshdport"];
$vname = $row["vname"];
$pid = $row["pid"];
$eid = $row["eid"];
......
......@@ -28,7 +28,7 @@ $reqargs = RequiredPageArguments("node", PAGEARG_NODE);
$node_id = $node->node_id();
$query_result =
DBQueryFatal("select n.jailflag,n.jailip,p.port, ".
DBQueryFatal("select n.jailflag,n.jailip,n.sshdport, ".
" r.vname,r.pid,r.eid, ".
" t.isvirtnode,t.isremotenode,t.isplabdslice, ".
" t.issubnode,t.class ".
......@@ -36,8 +36,6 @@ $query_result =
"left join reserved as r on n.node_id=r.node_id ".
"left join node_types as t on t.type=n.type ".
"left join os_info as oi on n.def_boot_osid=oi.osid ".
"left join port_registration as p on ".
" (n.node_id = p.node_id and p.service='sshd')".
"where n.node_id='$node_id'");
if (mysql_num_rows($query_result) == 0) {
......@@ -47,7 +45,7 @@ if (mysql_num_rows($query_result) == 0) {
$row = mysql_fetch_array($query_result);
$jailflag = $row["jailflag"];
$jailip = $row["jailip"];
$sshdport = $row["port"];
$sshdport = $row["sshdport"];
$vname = $row["vname"];
$pid = $row["pid"];
$eid = $row["eid"];
......
......@@ -3555,14 +3555,12 @@ class node:
output=("You do not have permission to access: "
+ argdict["node"]))
res = DBQueryFatal("select n.node_id,n.jailflag,p.port, "
res = DBQueryFatal("select n.node_id,n.jailflag,n.sshdport, "
" r.vname,r.pid,r.eid, "
" t.isvirtnode,t.isremotenode,t.isplabdslice "
" from nodes as n "
"left join reserved as r on n.node_id=r.node_id "
"left join node_types as t on t.type=n.type "
"left join port_registration as p on "
" (n.node_id = p.node_id and p.service='sshd')"
"where " + clause,
clause_args)
......
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