From 649efc396e9d1283a6ea337bff439a7b478f57a3 Mon Sep 17 00:00:00 2001 From: XuWei Date: Tue, 25 Jul 2017 23:08:11 -0400 Subject: [PATCH 1/3] modify rsetboot depending on URL & data --- xCAT-server/lib/xcat/plugins/openbmc.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 229555314..e5839a0f7 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -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, @@ -1363,7 +1363,7 @@ sub rsetboot_response { my $response_info = decode_json $response->content; - if ($node_info{$node}{cur_status} eq "RSETBOOT_GET_RESPONSE") { + if ($node_info{$node}{cur_status} eq "RSETBOOT_STATUS_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$/); From 24c78e6b1a4c0645d09dd4fc2cfa99cf0f7722f6 Mon Sep 17 00:00:00 2001 From: XuWei Date: Wed, 26 Jul 2017 22:51:40 -0400 Subject: [PATCH 2/3] modified depending on comments --- xCAT-server/lib/xcat/plugins/openbmc.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index e5839a0f7..63c8bb413 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -1367,7 +1367,7 @@ sub rsetboot_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$/); + xCAT::SvrUtils::sendmsg("Default", $callback, $node) if ($response_info->{'data'}->{BootSource} =~ /Default$/); } if ($next_status{ $node_info{$node}{cur_status} }) { From c45fd291232bb093be41651072299fc3d0a9fc8d Mon Sep 17 00:00:00 2001 From: XuWei Date: Thu, 27 Jul 2017 21:27:17 -0400 Subject: [PATCH 3/3] modified depending on comments --- xCAT-server/lib/xcat/plugins/openbmc.pm | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 63c8bb413..d00075d8a 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -1364,10 +1364,18 @@ sub rsetboot_response { my $response_info = decode_json $response->content; if ($node_info{$node}{cur_status} eq "RSETBOOT_STATUS_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("Default", $callback, $node) if ($response_info->{'data'}->{BootSource} =~ /Default$/); + 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} }) {