mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-05-29 09:13:08 +00:00
Merge pull request #3537 from xuweibj/rsetboot
modify rsetboot depending on URL & data
This commit is contained in:
commit
df3f9660a3
@ -217,15 +217,15 @@ my %status_info = (
|
||||
|
||||
RSETBOOT_SET_REQUEST => {
|
||||
method => "PUT",
|
||||
init_url => "$openbmc_project_url/control/boot/bootsource/attr/Sources",
|
||||
data => "xyz.openbmc_project.Control.Boot.Sources.",
|
||||
init_url => "$openbmc_project_url/control/host0/boot_source/attr/BootSource",
|
||||
data => "xyz.openbmc_project.Control.Boot.Source.Sources.",
|
||||
},
|
||||
RSETBOOT_SET_RESPONSE => {
|
||||
process => \&rsetboot_response,
|
||||
},
|
||||
RSETBOOT_STATUS_REQUEST => {
|
||||
method => "GET",
|
||||
init_url => "$openbmc_project_url/control/boot/bootsource",
|
||||
init_url => "$openbmc_project_url/control/host0/boot_source",
|
||||
},
|
||||
RSETBOOT_STATUS_RESPONSE => {
|
||||
process => \&rsetboot_response,
|
||||
@ -1361,11 +1361,19 @@ sub rsetboot_response {
|
||||
|
||||
my $response_info = decode_json $response->content;
|
||||
|
||||
if ($node_info{$node}{cur_status} eq "RSETBOOT_GET_RESPONSE") {
|
||||
xCAT::SvrUtils::sendmsg("Hard Drive", $callback, $node) if ($response_info->{'data'}->{BootSource} =~ /Disk$/);
|
||||
xCAT::SvrUtils::sendmsg("Network", $callback, $node) if ($response_info->{'data'}->{BootSource} =~ /Network$/);
|
||||
xCAT::SvrUtils::sendmsg("CD/DVD", $callback, $node) if ($response_info->{'data'}->{BootSource} =~ /ExternalMedia$/);
|
||||
xCAT::SvrUtils::sendmsg("boot override inactive", $callback, $node) if ($response_info->{'data'}->{BootSource} =~ /Default$/);
|
||||
if ($node_info{$node}{cur_status} eq "RSETBOOT_STATUS_RESPONSE") {
|
||||
if ($response_info->{'data'}->{BootSource} =~ /Disk$/) {
|
||||
xCAT::SvrUtils::sendmsg("Hard Drive", $callback, $node);
|
||||
} elsif ($response_info->{'data'}->{BootSource} =~ /Network$/) {
|
||||
xCAT::SvrUtils::sendmsg("Network", $callback, $node);
|
||||
} elsif ($response_info->{'data'}->{BootSource} =~ /ExternalMedia$/) {
|
||||
xCAT::SvrUtils::sendmsg("CD/DVD", $callback, $node);
|
||||
} elsif ($response_info->{'data'}->{BootSource} =~ /Default$/) {
|
||||
xCAT::SvrUtils::sendmsg("Default", $callback, $node);
|
||||
} else {
|
||||
my $error_msg = "Can not get valid rsetboot status, the data is " . $response_info->{'data'}->{BootSource};
|
||||
xCAT::SvrUtils::sendmsg("$error_msg", $callback, $node);
|
||||
}
|
||||
}
|
||||
|
||||
if ($next_status{ $node_info{$node}{cur_status} }) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user