Commit e90313ef authored by Leigh B. Stoller's avatar Leigh B. Stoller

Mixing OPT and template parameters, plus adding a couple of builtin

names, ends up with things not being ordered as I want them to be.
So, reorder things.
parent ffc20cca
......@@ -446,12 +446,27 @@ $instance->CopyDataStore($template_tag,
"$instance_path/template_datastore") == 0
or fatal(-1, "Could not copy datastore ($template_tag) to instance");
#
# Ick, Ick, Ick. I want these to be at the beginning of the enviroment
# strings so they are set in case the user has used any OPT variables
# in the NS file (and they refer to $DATASTORE or $ARCHIVE).
#
my $query_result =
DBQueryFatal("select MAX(idx) from virt_user_environment ".
"where pid='$pid' and eid='$eid'");
my ($maxenv) = $query_result->fetchrow_array();
for (my $idx = $maxenv; $idx > 0; $idx--) {
my $newidx = $idx + 2;
DBQueryFatal("update virt_user_environment set idx=$newidx ".
"where idx='$idx' and pid='$pid' and eid='$eid'");
}
DBQueryFatal("replace into virt_user_environment set ".
" name='DATASTORE', value='$instance_path/template_datastore',".
" pid='$pid', eid='$eid'");
" idx=1, pid='$pid', eid='$eid'");
DBQueryFatal("replace into virt_user_environment set ".
" name='ARCHIVE', value='$instance_path/archive',".
" pid='$pid', eid='$eid'");
" idx=2, pid='$pid', eid='$eid'");
#
# Now do the swapin (or it gets queued if a batch experiment).
......
......@@ -446,12 +446,27 @@ $instance->CopyDataStore($template_tag,
"$instance_path/template_datastore") == 0
or fatal(-1, "Could not copy datastore ($template_tag) to instance");
#
# Ick, Ick, Ick. I want these to be at the beginning of the enviroment
# strings so they are set in case the user has used any OPT variables
# in the NS file (and they refer to $DATASTORE or $ARCHIVE).
#
my $query_result =
DBQueryFatal("select MAX(idx) from virt_user_environment ".
"where pid='$pid' and eid='$eid'");
my ($maxenv) = $query_result->fetchrow_array();
for (my $idx = $maxenv; $idx > 0; $idx--) {
my $newidx = $idx + 2;
DBQueryFatal("update virt_user_environment set idx=$newidx ".
"where idx='$idx' and pid='$pid' and eid='$eid'");
}
DBQueryFatal("replace into virt_user_environment set ".
" name='DATASTORE', value='$instance_path/template_datastore',".
" pid='$pid', eid='$eid'");
" idx=1, pid='$pid', eid='$eid'");
DBQueryFatal("replace into virt_user_environment set ".
" name='ARCHIVE', value='$instance_path/archive',".
" pid='$pid', eid='$eid'");
" idx=2, pid='$pid', eid='$eid'");
#
# Now do the swapin (or it gets queued if a batch experiment).
......
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