Commit c94cbb7c authored by Leigh B Stoller's avatar Leigh B Stoller

Bug fixes.

parent 63a70a67
......@@ -62,6 +62,7 @@ sub Fatal($);
sub ChangeBootOrder($);
sub SendXML($$);
sub SetupControlNode($$);
sub DoOutlet($);
# un-taint path
$ENV{'PATH'} = '/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/site/bin';
......@@ -138,6 +139,12 @@ if ($control) {
exit(SetupControlNode($ARGV[0], $ARGV[1]));
}
if ($dooutlet) {
usage()
if (@ARGV != 1);
exit(DoOutlet($ARGV[0]));
}
usage()
if (@ARGV != 2);
......@@ -155,20 +162,6 @@ if (defined($management_interface)) {
}
my $iloIP = $management_interface->IP();
if ($dooutlet) {
#
# Add the outlet and authinfo.
#
$node->AddOutlet($type, 0,
{"key_type" => "ilo3",
"key_role" => "ssh-key",
"key_uid" => "elabman",
"key" => $DSAKEY}) == 0
or Fatal("Could not add outlet record");
exit(0);
}
#
# Before we create the interface, make sure we can install our
# login/password/key info on the ilo.
......@@ -396,3 +389,24 @@ sub SetupControlNode($$)
return 0;
}
sub DoOutlet($)
{
my ($node_id) = @_;
my $node = Node->Lookup($node_id);
if (!defined($node)) {
Fatal("No such node");
}
#
# Add the outlet and authinfo.
#
$node->AddOutlet("ilo3", 0,
{"key_type" => "ilo3",
"key_role" => "ssh-key",
"key_uid" => "elabman",
"key" => $DSAKEY}) == 0
or Fatal("Could not add outlet record");
return 0;
}
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