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

Update to default.rb library to handle frozen strings #430

Merged
merged 2 commits into from Apr 12, 2017

Conversation

Projects
None yet
4 participants
@bphinney
Contributor

bphinney commented Apr 12, 2017

When running under Chef client 13, Chef issues an error on the prepend method for the string because the strings are frozen objects. By moving the whitespace characters to the original array creation, we can do a simple non-destructive join, which solves the issue of not being allowed to change a frozen string in chef.

bphinney added some commits Apr 12, 2017

Update default.rb
In Chef 13, the prepend method on the string is failing due to Chef freezing objects.  By moving the extra whitespace characters to the original array, we are able to bypass that frozen object failure which just leaves us with joining the items.

@bphinney bphinney closed this Apr 12, 2017

@bphinney bphinney reopened this Apr 12, 2017

@bphinney

This comment has been minimized.

Show comment
Hide comment
@bphinney

bphinney Apr 12, 2017

Contributor

If you are actually adding kernel options, without this change, Chef 13 will throw an error.

Contributor

bphinney commented Apr 12, 2017

If you are actually adding kernel options, without this change, Chef 13 will throw an error.

@jjasghar

This comment has been minimized.

Show comment
Hide comment
@jjasghar

jjasghar Apr 12, 2017

Collaborator

Awesome! thanks for this!

Collaborator

jjasghar commented Apr 12, 2017

Awesome! thanks for this!

@jjasghar jjasghar merged commit 0a7f41b into rabbitmq:master Apr 12, 2017

1 check failed

continuous-integration/travis-ci/pr The Travis CI build could not complete due to an error
Details
end
rendered.each { |r| r.prepend(' ') }.join(",\n")
rendered.each { |r| r }.join(",\n")

This comment has been minimized.

@devsibwarra

devsibwarra Apr 12, 2017

Contributor

Is there a reason to keep .each {} for this line or can it go away?

@devsibwarra

devsibwarra Apr 12, 2017

Contributor

Is there a reason to keep .each {} for this line or can it go away?

This comment has been minimized.

@michaelklishin

michaelklishin Apr 12, 2017

Member

Looks like it can go.

@michaelklishin

michaelklishin Apr 12, 2017

Member

Looks like it can go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment