Commit 04ca1e2c authored by Kirk Webb's avatar Kirk Webb

Client-side support for "pnetnodeattrs" tmcd command.

parent 5a3c57fb
......@@ -43,7 +43,7 @@ use Exporter;
copyfilefromnfs getnodeuuid getarpinfo
getstorageconfig getstoragediskinfo getimagesize
getmanifest fetchmanifestblobs runbootscript runhooks
build_fake_macs getenvvars
build_fake_macs getenvvars getpnetnodeattrs
TBDebugTimeStamp TBDebugTimeStampWithDate
TBDebugTimeStampsOn TBDebugTimeStampsOff
......@@ -3677,6 +3677,34 @@ sub getimagesize($$;$) {
return 0;
}
#
# Return set of node attributes relevant for PhantomNet experiments.
#
sub getpnetnodeattrs($)
{
my ($rptr) = @_;
my @tmccresults = ();
my %result = ();
my %tmccopts = ();
if (tmcc(TMCCCMD_PNETNODEATTRS, undef, \@tmccresults, %tmccopts) < 0) {
warn("*** WARNING: Could not get PhantomNet node attrs from server!\n");
%$rptr = ();
return -1;
}
foreach my $line (@tmccresults) {
chomp $line;
if ($line =~ /^NODE_ID=(.+) KEY=(.+) VALUE=(.+)$/) {
push @{$result{$1}}, [$2, $3];
}
}
%$rptr = %result;
return 0;
}
#
# Fork a process to exec a command. Return the pid to wait on.
#
......
......@@ -54,6 +54,7 @@ use Exporter;
TMCCCMD_TPMBLOB TMCCCMD_TPMPUB TMCCCMD_DHCPDCONF TMCCCMD_MANIFEST
TMCCCMD_NODEUUID TMCCCMD_NODEATTRIBUTES TMCCCMD_DISKS
TMCCCMD_ARPINFO TMCCCMD_STORAGE TMCCCMD_IMAGESIZE
TMCCCMD_PNETNODEATTRS
);
# Must come after package declaration!
......@@ -220,6 +221,7 @@ my %commandset =
"arpinfo" => {TAG => "arpinfo"},
"storageconfig" => {TAG => "storageconfig"},
"imagesize" => {TAG => "imagesize"},
"pnetnodeattrs" => {TAG => "pnetnodeattrs"},
);
#
......@@ -296,6 +298,7 @@ sub TMCCCMD_DISKS() { $commandset{"disks"}->{TAG}; }
sub TMCCCMD_ARPINFO() { $commandset{"arpinfo"}->{TAG}; }
sub TMCCCMD_STORAGE() { $commandset{"storageconfig"}->{TAG}; }
sub TMCCCMD_IMAGESIZE() { $commandset{"imagesize"}->{TAG}; }
sub TMCCCMD_PNETNODEATTRS() {$commandset{"pnetnodeattrs"}->{TAG}; }
#
# Caller uses this routine to set configuration of this library
......
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