Commit 940c886b authored by Leigh B Stoller's avatar Leigh B Stoller

Add method to get the stored value of an experiment environment variable.

parent c803e17c
......@@ -1623,6 +1623,30 @@ sub WriteEnvVariables($)
return 0;
}
#
# Get value of a specific env variable
#
sub GetEnvVariable($$)
{
my ($self, $var) = @_;
# Must be a real reference.
return -1
if (! ref($self));
my $pid = $self->pid();
my $eid = $self->eid();
my $query_result =
DBQueryWarn("select value from virt_user_environment ".
"where pid='$pid' and eid='$eid' and name='$var'");
return undef
if (!defined($query_result) || !$query_result->numrows);
my ($value) = $query_result->fetchrow_array();
return $value;
}
#
# Experiment locking and state changes.
#
......
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