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

[omnibus] use YAML.dump to serialize simple hashes to disk #1896

Merged
merged 1 commit into from
Oct 22, 2020

Conversation

robbkidd
Copy link
Contributor

@robbkidd robbkidd commented Oct 22, 2020

Description

The data for this file resource's content is really a simple Ruby Hash built up from node attributes, not a node object itself. Instead of relying on the .to_yaml behavior previously patched onto Hash, use plain old Ruby YAML.dump with the Hash instead.

Resolves new "NoMethodError: undefined method 'to_yaml' for Hash" error when chefspec'ing.

Related Issue

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (non-breaking change that does not add functionality or fix an issue)

Checklist:

  • I have read the CONTRIBUTING document.
  • I have run the pre-merge tests locally and they pass.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • All commits have been signed-off for the Developer Certificate of Origin.

The data for this file resource's content is really a simple Ruby Hash
built up from node attributes, not a node object itself. Instead of
relying on the .to_yaml behavior previously patched onto Hash, use
plain old Ruby YAML.dump with the Hash instead.

Resolves new "NoMethodError: undefined method 'to_yaml' for Hash" error
when chefspec'ing.

Signed-off-by: Robb Kidd <rkidd@chef.io>
@robbkidd robbkidd added Type: Bug Does not work as expected. Expeditor: Skip Changelog Used to skip built_in:update_changelog. Aspect: Packaging Distribution of the projects 'compiled' artifacts. Component: Omnibus Involving the omnibus package or its build and removed Expeditor: Skip Changelog Used to skip built_in:update_changelog. labels Oct 22, 2020
@robbkidd robbkidd changed the title use YAML.dump to serialize a simple hash to a file [omnibus] use YAML.dump to serialize simple hashes to disk Oct 22, 2020
@robbkidd robbkidd merged commit dcfa5a8 into master Oct 22, 2020
@robbkidd robbkidd deleted the robb/yaml-dump-v-to-yaml branch October 22, 2020 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Aspect: Packaging Distribution of the projects 'compiled' artifacts. Component: Omnibus Involving the omnibus package or its build Type: Bug Does not work as expected.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants