2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-29 09:13:08 +00:00

Fix OpenPOWER detection regex

The old regex matches product IDs containing a 0 (like 1230 or 1023, ...), too.
This causes issues for some x86 Supermicro servers resulting in the following error:
  rpower node01 cycle
  node01: [xcat]: Error: unsupported command rpower cycle for OpenPOWER
The new regex fixes this issue and matches ^0$ only.
This commit is contained in:
Obihörnchen 2022-01-25 12:14:47 +01:00 committed by GitHub
parent 2a98545b04
commit 7fd9970c77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1619,7 +1619,7 @@ sub isopenpower {
if ($sessdata->{prod_id} == 43707 and $sessdata->{mfg_id} == 0) {
# mft_id 0 and prod_id 43707 is for Firestone,Minsky
return 1;
} elsif (($sessdata->{prod_id} =~ /0|2355|2437/) and $sessdata->{mfg_id} == 10876) {
} elsif (($sessdata->{prod_id} =~ /^(?:0|2355|2437)$/) and $sessdata->{mfg_id} == 10876) {
# mfg_id 10876 is for IBM Power S822LC for Big Data (Supermicro), prod_id 2355 for B&S, and 0 or 2437 for Boston
return 1;
} else {