Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
eee9c3e4
Commit
eee9c3e4
authored
Nov 08, 2000
by
Christopher Alfeld
Browse files
Modified to use DB instead of IR file.
parent
1b5fa804
Changes
1
Hide whitespace changes
Inline
Side-by-side
tbsetup/tbend.tcl
View file @
eee9c3e4
...
...
@@ -36,46 +36,39 @@ set nfree "$updir/db/nfree"
set libir
"
$scriptdir
/ir/libir.tcl"
set resetvlans
"
$scriptdir
/resetvlans.tcl"
source $libir
namespace import TB_LIBIR::ir
load $updir/lib/sql.so
if
{
$argc
!= 3
}
{
puts stderr
"Syntax:
$argv0
<pid> <eid>
<ir-file>
"
if
{
$argc
!= 3
&& $argc != 2
}
{
puts stderr
"Syntax:
$argv0
<pid> <eid>"
exit 1
}
if
{
$argc
== 3
}
{
puts stderr
"Warning: Ignoring IR file argument.
}
set DB
[
sql connect
]
sql selectdb $DB tbdb
set irFile
[
lindex $argv 2
]
set pid
[
lindex $argv 0
]
set eid
[
lindex $argv 1
]
set id
"
$pid-$eid
"
set t
[
split $irFile .
]
set prefix
[
join
[
lrange $t 0
[
expr
[
llength $t
]
- 2
]]
.
]
set irFile
"
$prefix.ir
"
set logFile
"
$prefix.log
"
set logFile
"
${id}
_end.log"
if
{[
catch
"open
$log
File a+"
logFp
]}
{
puts stderr
"Could not open
$log
File for writing."
exit 1
}
outs
"Input:
$ir
File"
outs
"Log:
$log
File"
if
{
!
[
file exists $irFile
]}
{
outs stderr
"
$ir
File does not exist"
exit 1
}
outs
""
outs
"Ending Testbed run for
$i
r
File
.
[
clock format
[
clock seconds
]]
"
outs
"Ending Testbed run for
$i
d
.
[
clock format
[
clock seconds
]]
"
outs
"Unallocating resources"
ir read $irFile
set nodemap
[
ir get /virtual/nodes
]
set machines
{}
foreach pair $nodemap
{
lappend machines
[
lindex $pair 1
]
sql query $DB
"select node_id from reserved where eid=
\"
$eid
\"
and pid=
\"
$pid
\"
"
while
{[
set machine
[
sql fetchrow $DB
]]
!=
{}}
{
lappend machines $machine
}
if
{[
catch
"exec
$nfree
$pid
$eid
>@
$log
Fp 2>@
$log
Fp"
err
]}
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment