Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

meta: Snap to_dict() cleanup #2950

Merged
merged 2 commits into from
Feb 21, 2020
Merged

Conversation

cjp256
Copy link
Contributor

@cjp256 cjp256 commented Feb 20, 2020

  • remove __dict__ usage and detail each property
  • remove snap.yaml-isms from to_dict, into newly added to_snap_yaml_dict()

Chris Patterson added 2 commits February 19, 2020 20:23
Similar to that done for from_dict(), get rid of __dict__ usage
in to_dict() and handle each field directly.  More verbose,
but detailed and more flexible.

Signed-off-by: Chris Patterson <chris.patterson@canonical.com>
When creating a dictionary, output all properties.  Move
the necessary transforms into write_snap_yaml(), in particular:

- applying passthrough property
- stripping adopt-info

Clean up and add test coverage for both cases.

Signed-off-by: Chris Patterson <chris.patterson@canonical.com>
@sergiusens sergiusens merged commit 5934e00 into canonical:master Feb 21, 2020
@cjp256 cjp256 deleted the snap-to-dict branch March 16, 2020 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants