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-stable
Commits
1644454f
Commit
1644454f
authored
Jun 28, 2006
by
Mike Hibler
Browse files
Handle undefined pid in template stuff
parent
e7c0795d
Changes
1
Hide whitespace changes
Inline
Side-by-side
tbsetup/ns2ir/parse-ns.in
View file @
1644454f
...
...
@@ -594,22 +594,24 @@ sub GenDefsFile($)
#
# For Templates.
#
$query_result
=
DBQueryFatal
("
select instance_idx from experiments
"
.
"
where pid='
$pid
' and eid='
$eid
'
");
my
(
$instance_idx
)
=
$query_result
->
fetchrow_array
();
if
(
$instance_idx
)
{
print
TCL
"
# Template goo
\n
";
if
(
defined
(
$pid
))
{
$query_result
=
DBQueryFatal
("
select * from experiment_template_instance_bindings
"
.
"
where instance_idx='
$instance_idx
'
");
DBQueryFatal
("
select instance_idx from experiments
"
.
"
where pid='
$pid
' and eid='
$eid
'
");
my
(
$instance_idx
)
=
$query_result
->
fetchrow_array
();
if
(
$instance_idx
)
{
print
TCL
"
# Template goo
\n
";
$query_result
=
DBQueryFatal
("
select * from experiment_template_instance_bindings
"
.
"
where instance_idx='
$instance_idx
'
");
while
(
my
%row
=
$query_result
->
fetchhash
())
{
my
$name
=
$row
{'
name
'};
my
$value
=
$row
{'
value
'};
while
(
my
%row
=
$query_result
->
fetchhash
())
{
my
$name
=
$row
{'
name
'};
my
$value
=
$row
{'
value
'};
print
TCL
"
set parameter_list_defaults(
$name
)
\"
$value
\"\n
";
print
TCL
"
set parameter_list_defaults(
$name
)
\"
$value
\"\n
";
}
}
}
...
...
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