Order by order in DMTF registry
The DMTF registry has a defined order. Previously these were randomly
ordered dependent on the hash function used when they were generated
years ago.
Functionally the only change here is to parse_registries.py, to remove
the sorting, then to regenerate the files.
Tested: On last patch in series.
Change-Id: I7432c26ec4a1b18acf63ece85500df370f4758d3
Signed-off-by: Ed Tanous <etanous@nvidia.com>
diff --git a/scripts/parse_registries.py b/scripts/parse_registries.py
index 573f8a7..a7eb5bf 100755
--- a/scripts/parse_registries.py
+++ b/scripts/parse_registries.py
@@ -236,103 +236,6 @@
return "bad_request"
-def get_old_index(entry):
- old_order = [
- "ResourceInUse",
- "MalformedJSON",
- "ResourceMissingAtURI",
- "ActionParameterValueFormatError",
- "ActionParameterValueNotInList",
- "InternalError",
- "UnrecognizedRequestBody",
- "ResourceAtUriUnauthorized",
- "ActionParameterUnknown",
- "ResourceCannotBeDeleted",
- "PropertyDuplicate",
- "ServiceTemporarilyUnavailable",
- "ResourceAlreadyExists",
- "AccountForSessionNoLongerExists",
- "CreateFailedMissingReqProperties",
- "PropertyValueFormatError",
- "PropertyValueNotInList",
- "PropertyValueOutOfRange",
- "ResourceAtUriInUnknownFormat",
- "ServiceDisabled",
- "ServiceInUnknownState",
- "EventSubscriptionLimitExceeded",
- "ActionParameterMissing",
- "StringValueTooLong",
- "SessionTerminated",
- "SubscriptionTerminated",
- "ResourceTypeIncompatible",
- "ResetRequired",
- "ChassisPowerStateOnRequired",
- "ChassisPowerStateOffRequired",
- "PropertyValueConflict",
- "PropertyValueResourceConflict",
- "PropertyValueExternalConflict",
- "PropertyValueIncorrect",
- "ResourceCreationConflict",
- "MaximumErrorsExceeded",
- "PreconditionFailed",
- "PreconditionRequired",
- "OperationFailed",
- "OperationTimeout",
- "PropertyValueTypeError",
- "PropertyValueError",
- "ResourceNotFound",
- "CouldNotEstablishConnection",
- "PropertyNotWritable",
- "QueryParameterValueTypeError",
- "ServiceShuttingDown",
- "ActionParameterDuplicate",
- "ActionParameterNotSupported",
- "SourceDoesNotSupportProtocol",
- "StrictAccountTypes",
- "AccountRemoved",
- "AccessDenied",
- "QueryNotSupported",
- "CreateLimitReachedForResource",
- "GeneralError",
- "Success",
- "Created",
- "NoOperation",
- "PropertyUnknown",
- "NoValidSession",
- "InvalidObject",
- "ResourceInStandby",
- "ActionParameterValueTypeError",
- "ActionParameterValueError",
- "SessionLimitExceeded",
- "ActionNotSupported",
- "InvalidIndex",
- "EmptyJSON",
- "QueryNotSupportedOnResource",
- "QueryNotSupportedOnOperation",
- "QueryCombinationInvalid",
- "EventBufferExceeded",
- "InsufficientPrivilege",
- "PropertyValueModified",
- "AccountNotModified",
- "QueryParameterValueFormatError",
- "PropertyMissing",
- "ResourceExhaustion",
- "AccountModified",
- "QueryParameterOutOfRange",
- "PasswordChangeRequired",
- "InsufficientStorage",
- "OperationNotAllowed",
- "ArraySizeTooLong",
- "Invalid File",
- "GenerateSecretKeyRequired",
- ]
-
- if entry[0] in old_order:
- return old_order.index(entry[0])
- else:
- return 999999
-
-
def make_error_function(entry_id, entry, is_header):
arg_as_url = {
@@ -501,12 +404,11 @@
def create_error_registry(entry):
file, json_dict, namespace, url = entry
- messages = OrderedDict(
- sorted(json_dict["Messages"].items(), key=get_old_index)
- )
error_messages_hpp = os.path.join(
SCRIPT_DIR, "..", "redfish-core", "include", "error_messages.hpp"
)
+ messages = json_dict["Messages"]
+
with open(
error_messages_hpp,
"w",
@@ -525,7 +427,6 @@
#include <source_location>
#include <string>
#include <string_view>
-#include <utility>
// IWYU pragma: no_forward_declare crow::Response