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

Handle backwards compatibility with force_new_section_creation #288

Merged
merged 1 commit into from Jul 2, 2018

Conversation

mwhahaha
Copy link
Contributor

Prior to the introduction of this new parameter in the ini_setting type,
a user may have had their own custom type which implemented the required
parameters. The introduction of this new type would break anyone who was
not inheriting from the provide ini_setting type. This change adds a
check before looking for this option to allow those users to continue to
work. If the force_new_section_creation is not defined on the type, the
previous expected functionality of automatic creation of the section
will occur.

Related-Bug: https://bugs.launchpad.net/puppet-openstacklib/+bug/1778247

Copy link

@hsitin hsitin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried running the module with the changes you have mentioned. I found that resource.respond_to?(:force_new_section_creation) always returns False. Hence the code always moving to the else part and thus always calls the create function.

@mwhahaha
Copy link
Contributor Author

Is there an alternative function to use to see if a param is on a type?

Prior to the introduction of this new parameter in the ini_setting type,
a user may have had their own custom type which implemented the required
parameters. The introduction of this new type would break anyone who was
not inheriting from the provide ini_setting type. This change adds a
check before looking for this option to allow those users to continue to
work.  If the force_new_section_creation is not defined on the type, the
previous expected functionality of automatic creation of the section
will occur.

Related-Bug: https://bugs.launchpad.net/puppet-openstacklib/+bug/1778247
@mwhahaha
Copy link
Contributor Author

@hsitin, @david22swan please retest this version, I think this will work correctly now

@david22swan
Copy link
Member

Passed on adhoc

@david22swan david22swan merged commit c0acd9c into puppetlabs:master Jul 2, 2018
apevec pushed a commit to redhat-openstack/rdoinfo that referenced this pull request Jul 3, 2018
This reverts commit f8648b2.

puppetlabs/puppetlabs-inifile#288 has
been merged to allow for backwards compatibility.

Change-Id: I52673b6a8524ce0fe33df6c08f1aa6e058524b51
Closes-Bug: LP#1778247
@pmcmaw
Copy link
Contributor

pmcmaw commented Jul 4, 2018

Hey! @hsitin

I am going to cut a release of inifile, just want to ensure that you are happy enough that the changes have resolved the issue you were seeing regarding resource.respond_to?(:force_new_section_creation) always returning False.

Many Thanks
Paula

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants