Commit 49003a26 authored by Mac Newbold's avatar Mac Newbold
Browse files

Small fix for perl oddity. Note to self: Do not expect...

Small fix for perl oddity. Note to self: Do not expect $myhash{TB_CONSTANT_SUB} to work since it evals TB_CONSTANT_SUB as a string unless you force it to be an expression (ie with parens).
parent 15dda9d5
......@@ -43,8 +43,9 @@ use libtestbed;
use English;
# Constants
my $MBKERNEL = TB_OSID_MBKERNEL;
my %osidmap = # Map some magic OSIDs to op_modes
( (TB_OSID_MBKERNEL) => "MINIMAL");
( $MBKERNEL => "MINIMAL");
# Global vars
my $d=0; # debug/verbose
......@@ -220,7 +221,7 @@ sub node_opmode() {
sub os_opmode() {
my $osid = shift || "";
if ($pathmode) { return $osidmap{TB_OSID_MBKERNEL}; }
if ($pathmode) { return $osidmap{$MBKERNEL}; }
if (defined($osidmap{$osid})) { return $osidmap{$osid}; }
my $cmd = "select op_mode from os_info where osid='$osid';";
my $q = DBQueryFatal($cmd);
......
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