Commit 1040f711 authored by Leigh Stoller's avatar Leigh Stoller

Initialize new interface_state table when entries new nodes

(interfaces) are added to the DB.
parent f55e466c
#!/usr/bin/perl -wT
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2007 University of Utah and the Flux Group.
# Copyright (c) 2000-2008 University of Utah and the Flux Group.
# All rights reserved.
#
use English;
......@@ -274,6 +274,10 @@ else {
"values ('$nodename', 0, 1, '$nodeip', ".
" 'fxp', '$control_iface', '$ifacerole')");
DBQueryFatal("insert into interface_state ".
"(node_id, card, port, iface) ".
"values ('$nodename', 0, 1, 'fxp')");
DBQueryFatal("insert into reserved ".
"(node_id, exptidx, pid, eid, rsrv_time, vname) ".
"values ('$nodename', $exptidx, ".
......
......@@ -1600,6 +1600,11 @@ class Plab:
(nodeid, 0, 1, nodeent['IP'], 'plab_fake',
controliface, 'ctrl'))
DBQueryFatal("replace into interface_state"
" (node_id, card, port, iface)"
" values (%s, %s, %s, %s)",
(nodeid, 0, 1, controliface))
# ensure to mark as undeleted...
DBQueryFatal("update plab_mapping set deleted=0" \
" where node_id=%s",(nodeid,))
......
......@@ -470,6 +470,9 @@ NODE: foreach my $node_id (@node_ids) {
"interface_type='$iface_type', iface='$iface', uuid=UUID(), " .
"current_speed='$max_speed', duplex=$duplex, role='$iface_role'");
DBQueryFatal("INSERT INTO interface_state SET node_id='$node_id', " .
"card=$card, port=1, iface='$iface'");
if (!$switch_id) {
print "No switch found for ${node_id}:$iface - skipping\n";
next;
......
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