Skip to content

Commit

Permalink
RedfishClientPkg/ComputerSystem: rename Redpath to ConfigLang
Browse files Browse the repository at this point in the history
To prevent confusion, Redpath is renamed to configure language in ReadMe.
So, having this change to rename "Redpath" to "ConfigLang" in source
code.

Signed-off-by: Nickle Wang <nicklew@nvidia.com>
  • Loading branch information
nicklela committed Aug 16, 2024
1 parent 4db84ff commit 6fa8d3b
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -528,9 +528,9 @@ ProvisioningComputerSystemResources (
return EFI_INVALID_PARAMETER;
}

Status = RedfishFeatureGetUnifiedArrayTypeConfigureLang (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, REDPATH_ARRAY_PATTERN, &UnifiedConfigureLangList);
Status = RedfishFeatureGetUnifiedArrayTypeConfigureLang (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, CONFIG_LANG_ARRAY_PATTERN, &UnifiedConfigureLangList);
if (EFI_ERROR (Status) || (UnifiedConfigureLangList.Count == 0)) {
DEBUG ((DEBUG_ERROR, "%a: No HII question found with configure language: %s: %r\n", __func__, REDPATH_ARRAY_PATTERN, Status));
DEBUG ((DEBUG_ERROR, "%a: No HII question found with configure language: %s: %r\n", __func__, CONFIG_LANG_ARRAY_PATTERN, Status));
return EFI_NOT_FOUND;
}

Expand Down Expand Up @@ -712,7 +712,7 @@ RedfishCheckResourceCommon (
return EFI_SUCCESS;
}

Status = RedfishPlatformConfigGetConfigureLang (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, REDPATH_ARRAY_PATTERN, &ConfigureLangList, &Count);
Status = RedfishPlatformConfigGetConfigureLang (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, CONFIG_LANG_ARRAY_PATTERN, &ConfigureLangList, &Count);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "%a: failed: %r\n", __func__, Status));
return Status;
Expand Down Expand Up @@ -875,7 +875,7 @@ RedfishIdentifyResourceCommon (

Supported = RedfishIdentifyResource (Private->Uri, Json);
if (Supported) {
Status = RedfishFeatureGetUnifiedArrayTypeConfigureLang (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, REDPATH_ARRAY_PATTERN, &ConfigLangList);
Status = RedfishFeatureGetUnifiedArrayTypeConfigureLang (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, CONFIG_LANG_ARRAY_PATTERN, &ConfigLangList);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "%a: RedfishFeatureGetUnifiedArrayTypeConfigureLang failed: %r\n", __func__, Status));
return Status;
Expand All @@ -893,17 +893,17 @@ RedfishIdentifyResourceCommon (
}

// EndOfChar = StrStr (ConfigLangList.List[0].ConfigureLang, L"}");
Status = IsRedpathArray (ConfigLangList.List[0].ConfigureLang, NULL, &EndOfChar);
Status = IsConfigLangArray (ConfigLangList.List[0].ConfigureLang, NULL, &EndOfChar);
if (EFI_ERROR (Status) && (Status != EFI_NOT_FOUND)) {
ASSERT (FALSE);
return EFI_DEVICE_ERROR;
}

if (Status != EFI_SUCCESS) {
//
// This is not the collection redpath.
// This is not the collection config language.
//
GetRedpathNodeByIndex (ConfigLangList.List[0].ConfigureLang, 0, &EndOfChar);
GetConfigLangNodeByIndex (ConfigLangList.List[0].ConfigureLang, 0, &EndOfChar);
}

*(++EndOfChar) = '\0';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Redfish feature driver implementation - internal header file
(C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP<BR>
Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
Copyright (c) 2022-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Expand All @@ -17,13 +17,13 @@
//
// Schema information.
//
#define RESOURCE_SCHEMA "ComputerSystem"
#define RESOURCE_SCHEMA_MAJOR "1"
#define RESOURCE_SCHEMA_MINOR "13"
#define RESOURCE_SCHEMA_ERRATA "0"
#define RESOURCE_SCHEMA_VERSION "v1_13_0"
#define REDPATH_ARRAY_PATTERN L"/Systems/\\{.*\\}/"
#define REDPATH_ARRAY_PREFIX L"/Systems/"
#define RESOURCE_SCHEMA_FULL "x-UEFI-redfish-ComputerSystem.v1_13_0"
#define RESOURCE_SCHEMA "ComputerSystem"
#define RESOURCE_SCHEMA_MAJOR "1"
#define RESOURCE_SCHEMA_MINOR "13"
#define RESOURCE_SCHEMA_ERRATA "0"
#define RESOURCE_SCHEMA_VERSION "v1_13_0"
#define CONFIG_LANG_ARRAY_PATTERN L"/Systems/\\{.*\\}/"
#define CONFIG_LANG_ARRAY_PREFIX L"/Systems/"
#define RESOURCE_SCHEMA_FULL "x-UEFI-redfish-ComputerSystem.v1_13_0"

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -1398,9 +1398,9 @@ ProvisioningComputerSystemResources (
return EFI_INVALID_PARAMETER;
}

Status = RedfishFeatureGetUnifiedArrayTypeConfigureLang (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, REDPATH_ARRAY_PATTERN, &UnifiedConfigureLangList);
Status = RedfishFeatureGetUnifiedArrayTypeConfigureLang (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, CONFIG_LANG_ARRAY_PATTERN, &UnifiedConfigureLangList);
if (EFI_ERROR (Status) || (UnifiedConfigureLangList.Count == 0)) {
DEBUG ((DEBUG_ERROR, "%a: No HII question found with configure language: %s: %r\n", __func__, REDPATH_ARRAY_PATTERN, Status));
DEBUG ((DEBUG_ERROR, "%a: No HII question found with configure language: %s: %r\n", __func__, CONFIG_LANG_ARRAY_PATTERN, Status));
return EFI_NOT_FOUND;
}

Expand Down Expand Up @@ -1582,7 +1582,7 @@ RedfishCheckResourceCommon (
return EFI_SUCCESS;
}

Status = RedfishPlatformConfigGetConfigureLang (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, REDPATH_ARRAY_PATTERN, &ConfigureLangList, &Count);
Status = RedfishPlatformConfigGetConfigureLang (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, CONFIG_LANG_ARRAY_PATTERN, &ConfigureLangList, &Count);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "%a: failed: %r\n", __func__, Status));
return Status;
Expand Down Expand Up @@ -1745,7 +1745,7 @@ RedfishIdentifyResourceCommon (

Supported = RedfishIdentifyResource (Private->Uri, Json);
if (Supported) {
Status = RedfishFeatureGetUnifiedArrayTypeConfigureLang (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, REDPATH_ARRAY_PATTERN, &ConfigLangList);
Status = RedfishFeatureGetUnifiedArrayTypeConfigureLang (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, CONFIG_LANG_ARRAY_PATTERN, &ConfigLangList);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "%a: RedfishFeatureGetUnifiedArrayTypeConfigureLang failed: %r\n", __func__, Status));
return Status;
Expand All @@ -1763,17 +1763,17 @@ RedfishIdentifyResourceCommon (
}

// EndOfChar = StrStr (ConfigLangList.List[0].ConfigureLang, L"}");
Status = IsRedpathArray (ConfigLangList.List[0].ConfigureLang, NULL, &EndOfChar);
Status = IsConfigLangArray (ConfigLangList.List[0].ConfigureLang, NULL, &EndOfChar);
if (EFI_ERROR (Status) && (Status != EFI_NOT_FOUND)) {
ASSERT (FALSE);
return EFI_DEVICE_ERROR;
}

if (Status != EFI_SUCCESS) {
//
// This is not the collection redpath.
// This is not the collection config language.
//
GetRedpathNodeByIndex (ConfigLangList.List[0].ConfigureLang, 0, &EndOfChar);
GetConfigLangNodeByIndex (ConfigLangList.List[0].ConfigureLang, 0, &EndOfChar);
}

*(++EndOfChar) = '\0';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Redfish feature driver implementation - internal header file
(C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP<BR>
Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
Expand All @@ -15,13 +16,13 @@
//
// Schema information.
//
#define RESOURCE_SCHEMA "ComputerSystem"
#define RESOURCE_SCHEMA_MAJOR "1"
#define RESOURCE_SCHEMA_MINOR "5"
#define RESOURCE_SCHEMA_ERRATA "0"
#define RESOURCE_SCHEMA_VERSION "v1_5_0"
#define REDPATH_ARRAY_PATTERN L"/Systems/\\{.*\\}/"
#define REDPATH_ARRAY_PREFIX L"/Systems/"
#define RESOURCE_SCHEMA_FULL "x-UEFI-redfish-ComputerSystem.v1_5_0"
#define RESOURCE_SCHEMA "ComputerSystem"
#define RESOURCE_SCHEMA_MAJOR "1"
#define RESOURCE_SCHEMA_MINOR "5"
#define RESOURCE_SCHEMA_ERRATA "0"
#define RESOURCE_SCHEMA_VERSION "v1_5_0"
#define CONFIG_LANG_ARRAY_PATTERN L"/Systems/\\{.*\\}/"
#define CONFIG_LANG_ARRAY_PREFIX L"/Systems/"
#define RESOURCE_SCHEMA_FULL "x-UEFI-redfish-ComputerSystem.v1_5_0"

#endif

0 comments on commit 6fa8d3b

Please sign in to comment.