mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-05-21 19:22:05 +00:00
Processor DD version check in Perl
This commit is contained in:
parent
484c383524
commit
74874062d5
@ -527,6 +527,16 @@ class OpenBMCFlashTask(ParallelNodesCommand):
|
||||
|
||||
try:
|
||||
obmc.login()
|
||||
# Before uploading file, check CPU DD version
|
||||
inventory_info_dict = obmc.get_inventory_info()
|
||||
cpu_info = inventory_info_dict["CPU"]
|
||||
for info in cpu_info:
|
||||
if info.startswith("CPU0 Version : 20"):
|
||||
# Display warning the only certain firmware versions are supported on DD 2.0
|
||||
self.callback.info( '%s: Warning: DD 2.0 processor detected on this node, should not have firmware > ibm-v2.0-0-r13.6 (BMC) and > v1.19_1.94 (Host).' % node)
|
||||
if info.startswith("CPU0 Version : 21"):
|
||||
if self.verbose:
|
||||
self.callback.info( '%s: DD 2.1 processor' % node)
|
||||
except (SelfServerException, SelfClientException) as e:
|
||||
return self._msg_process(node, e.message, msg_type='E')
|
||||
|
||||
|
@ -4615,6 +4615,7 @@ sub rflash_upload {
|
||||
# curl commands
|
||||
my $curl_login_cmd = "curl -c $cjar_id -k -H 'Content-Type: application/json' -X POST $request_url/login -d '" . $content_login . "'";
|
||||
my $curl_logout_cmd = "curl -b $cjar_id -k -H 'Content-Type: application/json' -X POST $request_url/logout -d '" . $content_logout . "'";
|
||||
my $curl_check_cpu_dd_cmd = "curl -b $cjar_id -k -H 'Content-Type: application/json' -X GET $request_url/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0 | grep Version | cut -d: -f2";
|
||||
|
||||
if (%fw_tar_files) {
|
||||
foreach my $key (keys %fw_tar_files) {
|
||||
@ -4646,6 +4647,17 @@ sub rflash_upload {
|
||||
}
|
||||
if ($h->{message} eq $::RESPONSE_OK) {
|
||||
if(%curl_upload_cmds){
|
||||
# Before uploading file, check CPU DD version
|
||||
my $curl_dd_check_result = `$curl_check_cpu_dd_cmd`;
|
||||
if ($curl_dd_check_result =~ "20") {
|
||||
# Display warning the only certain firmware versions are supported on DD 2.0
|
||||
xCAT::SvrUtils::sendmsg("Warning: DD 2.0 processor detected on this node, should not have firmware > ibm-v2.0-0-r13.6 (BMC) and > v1.19_1.94 (Host).", $callback, $node);
|
||||
}
|
||||
if ($curl_dd_check_result =~ "21") {
|
||||
if ($::VERBOSE) {
|
||||
xCAT::SvrUtils::sendmsg("DD 2.1 processor", $callback, $node);
|
||||
}
|
||||
}
|
||||
while((my $file,my $version)=each(%fw_tar_files)){
|
||||
my $uploading_msg = "Uploading $file ...";
|
||||
my $upload_cmd = $curl_upload_cmds{$file};
|
||||
|
Loading…
x
Reference in New Issue
Block a user