Skip to content

Commit

Permalink
Fix wrong product property name
Browse files Browse the repository at this point in the history
  • Loading branch information
uweseimet committed Mar 27, 2024
1 parent 406ed3c commit be9b674
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion cpp/s2p/s2p_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ void S2p::SetDeviceProperties(PbDeviceDefinition &device, const string &key, con
else if (key == "caching_mode") {
device.set_caching_mode(ParseCachingMode(value));
}
else if (key == "product_data") {
else if (key == "product") {
SetProductData(device, value);
}
else if (key == "params") {
Expand Down
14 changes: 7 additions & 7 deletions cpp/s2p/s2p_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ property_map S2pParser::ParseArguments(span<char*> initial_args, bool &has_sasi,
string id_lun;
string type;
string scsi_level;
string product_data;
string product;
string block_size;
string caching_mode;
bool blue_scsi_mode = false;
Expand Down Expand Up @@ -162,7 +162,7 @@ property_map S2pParser::ParseArguments(span<char*> initial_args, bool &has_sasi,
continue;

case 'n':
product_data = optarg;
product = optarg;
continue;

case 't':
Expand Down Expand Up @@ -218,8 +218,8 @@ property_map S2pParser::ParseArguments(span<char*> initial_args, bool &has_sasi,
if (!scsi_level.empty()) {
properties[device_key + "scsi_level"] = scsi_level;
}
if (!product_data.empty()) {
properties[device_key + "product_data"] = product_data;
if (!product.empty()) {
properties[device_key + "product"] = product;
}
if (!params.empty()) {
properties[device_key + "params"] = params;
Expand All @@ -228,7 +228,7 @@ property_map S2pParser::ParseArguments(span<char*> initial_args, bool &has_sasi,
id_lun = "";
type = "";
scsi_level = "";
product_data = "";
product = "";
block_size = "";
caching_mode = "";
}
Expand Down Expand Up @@ -290,13 +290,13 @@ string S2pParser::ParseBlueScsiFilename(property_map &properties, const string &
}
// When there is no block_size number after the "_" separator the string is the product data
else {
properties[device_key + "product_data"] = components[1];
properties[device_key + "product"] = components[1];
}
}
properties[device_key + "block_size"] = block_size;

if (components.size() > 2) {
properties[device_key + "product_data"] = components[2];
properties[device_key + "product"] = components[2];
}

return device_key;
Expand Down

0 comments on commit be9b674

Please sign in to comment.