modify statedict: enable storing dict via json.dump #1410
Merged
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.
attr_property has the ability to set state for attributes created with the "json" type with values of the list or dict type.
nixops/nixops/util.py
Lines 487 to 488 in a287225
The diff engine uses the newer StateDict, which has it's own setter for state.
nixops/nixops/state.py
Lines 31 to 37 in 78a8815
The nixops-aws VPC resources which motivated the diff engine never had a dict case, so I guess it was left out, but it's important to keep this functionality for other resources which want to use the diff engine in the future (I am working on some).