Merged
Conversation
This commit fixes several related issues. Primary issue: Function pcs.common.interface.dto.to_dict wasn't working properly. It failed to convert Enum values to their primitive type counterparts (value = enum_value.value). Up until Python 3.15, this error was masked by json.dumps doing the conversion. However, this stopped working with Python 3.15, exposing the error. There were several causes of this error: 1) The function failed to run recursively on lists of Enum. 2) The function failed to run recursively on dataclass fields typed as Unions. 3) The function failed to run recursively on dataclass fields with forward references in type hints, which are used to implement recursive data structures. In the process of fixing these, _convert_dict function got cleaned up. Some cleaning happened on the module level, as well. Other fixes: * Unions are no longer allowed in dataclasses, so StringSequence and StringCollections (which are Unions) got replaced there. * pcs.cli.cluster_property.output.PropertyConfigurationFacade got fixed. * pcs_test/tier0/lib/permissions/config/test_parser.py got fixed * it used a wrong function to convert a DTO to a dict * in an attempt to simulate invalid input, it was creating invalid DTOs
This is a follow up to the previous commit. pcs.common.interface.dto.from_dict functionality has been updated to implement fixes developed for to_dict. Although there was no error observer with the previous implementation, the functions are rather similar and they both use the same functions. Since these used functions have been modified for to_dict, from_dict must have been updated to match.
Pederrr
approved these changes
Mar 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.