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

Allow multiple rings in nodelist #291

Closed
wants to merge 1 commit into from

Conversation

rhamon
Copy link

@rhamon rhamon commented Jun 21, 2016

Please check the following items before submitting a PR -- thank you!

Note that this project is released with a Contributor Code of Conduct.
By participating in this project you agree to abide by its terms.
Contributor Code of Conduct.

  • There is no existing PR that addresses this problem
  • Mentioned any existing issues in your commit so they get linked and
    closed once this PR gets merged, i.e: Closes #1554 in the body of a commit
  • Followed the instructions in the Contributing document
  • Ran the unit/spec tests and ensured they still pass
  • Added tests to cover the new behaviour
  • Updated the documentation to match the changes
  • When possible, add an entry to the CHANGELOG file
  • Squashed your PR down to a single commit. You may forego this if the PR
    tries to address multiple issues. Though we prefer one PR per feature/fix,
    sometimes that's not feasible. In that case ensure that a single feature/fix
    and associated tests and documentation is bundled up in one commit

Optional, but extra points:

  • Added tests to ensure the old behaviour cannot accidentally be
    reintroduced

or ( is_array($unicast_addresses) and is_array($unicast_addresses[0]) and size($unicast_addresses[0]) > 1 )
or ( is_array($quorum_members) and is_array($quorum_members[0]) and size($quorum_members[0]) > 1 )
and $rrp_mode == 'none' {
fail('You must set rrp_mode to active or passive with multiple rings')
Copy link
Member

Choose a reason for hiding this comment

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

Do you really think that the validation belongs to the Puppet module?

Copy link
Member

Choose a reason for hiding this comment

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

IMO this is correct. the logic is a bit complex but we should keep it.

@roidelapluie
Copy link
Member

Hello, Thanks for your pull requests.

Could you please add tests to prevent future regressions?

@rhamon rhamon closed this Jun 21, 2016
@roidelapluie roidelapluie reopened this Jun 21, 2016
@roidelapluie
Copy link
Member

Why are you closing this?

@rhamon
Copy link
Author

rhamon commented Jun 23, 2016

Spent 30mins trying to get spec going and started feeling frustrated, so
moved on to other happy thoughts.
On Jun 21, 2016 6:17 PM, "Julien Pivotto" notifications@github.com wrote:

Why are you closing this?


You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
#291 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AGq6a66zgPvEcjUPFIhaA3z5QDRm77h2ks5qOGMTgaJpZM4I7LN2
.

@roidelapluie
Copy link
Member

ok

@bastelfreak
Copy link
Member

bastelfreak commented Jun 23, 2016

Hi @rhamon, thanks for your work. Please don't delete your branch yet - I would like to pick it up and add missing tests/fix them. This PR should be sufficient to implement #262

@bastelfreak bastelfreak reopened this Jun 23, 2016
@bastelfreak bastelfreak self-assigned this Jun 23, 2016
@@ -96,7 +96,9 @@ quorum {
nodelist {
<% [@quorum_members].flatten.each_index do |i| -%>
Copy link
Author

Choose a reason for hiding this comment

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

This is broken, will commit <% Array(@quorum_members).each_index do |i| -%>

@rhamon
Copy link
Author

rhamon commented Jun 23, 2016

The failures from "travis-ci" are about not finding a proper version of puppet-lint... what am I supposed to do about it? Can I still tick the box "Ran the unit/spec tests and ensured they still pass"?

@bastelfreak
Copy link
Member

yeah we broke that yesterday evening - sorry about that :( I will try to fix that tomorrow

or ( is_array($unicast_addresses) and is_array($unicast_addresses[0]) and size($unicast_addresses[0]) > 1 )
or ( is_array($quorum_members) and is_array($quorum_members[0]) and size($quorum_members[0]) > 1 ) )
and $rrp_mode == 'none' {
fail('You must set rrp_mode to active or passive with multiple rings')
Copy link
Member

@roidelapluie roidelapluie Jun 24, 2016

Choose a reason for hiding this comment

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

Please drop this, I think it is best to use:

file {
   'corosync.conf':
    validate_cmd => 'corosync -t'
}

Copy link
Author

Choose a reason for hiding this comment

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

Would using validate_cmd from puppetlabs-stdlib be okay?
validate_cmd(template($corosync_conf), 'corosync -t', 'Corosync failed to validate /etc/corosync/corosync.conf')

Copy link
Member

Choose a reason for hiding this comment

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

no, we should use standard file { validate_cmd
}

Copy link
Member

Choose a reason for hiding this comment

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

The approcach in #294 is better than this ?

Copy link
Author

Choose a reason for hiding this comment

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

Much better, yes.
Validate_cmd is only in puppet 3.5+, would be nice to fallback to stdlib for previous versions.

Copy link
Member

@roidelapluie roidelapluie Jun 27, 2016

Choose a reason for hiding this comment

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

Then we will wait for the 4.0 version of this module before releasing #294. At that time we will remove support for Puppet < 3.6. I do not think that it is useful to get a workaround until then.

Copy link
Member

@roidelapluie roidelapluie Aug 19, 2016

Choose a reason for hiding this comment

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

#294 is merged, you can remove that block :)

Copy link
Author

Choose a reason for hiding this comment

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

I still need this as our company is not ready to upgrade puppet to 3.6+...

Copy link
Member

Choose a reason for hiding this comment

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

master is no longer compatible with Puppet < 3.6.

@roidelapluie
Copy link
Member

@rhamon #294 is merged. Can you please rebase and fix conflicts?

@roidelapluie roidelapluie added needs-feedback Further information is requested needs-work not ready to merge just yet labels Aug 19, 2016
@roidelapluie roidelapluie modified the milestones: 6.x, 5.x Aug 25, 2016
@roidelapluie roidelapluie changed the title Allow multiple rings in nodelist and validate rrp_mode Allow multiple rings in nodelist Aug 25, 2016
@roidelapluie
Copy link
Member

needs tests

@rhamon
Copy link
Author

rhamon commented Aug 25, 2016

rebased

@rhamon
Copy link
Author

rhamon commented Aug 25, 2016

I don't like the [...].flatten everywhere. I believe using Array() is the way to ensure you get an Array where you expect one. http://docs.ruby-lang.org/en/2.0.0/Kernel.html#method-i-Array

@roidelapluie
Copy link
Member

You still miss tests. With tests you do not believe, you know :)

@rhamon
Copy link
Author

rhamon commented Aug 25, 2016

unfortunately not going to happen anytime soon... the desire and/or will to learn spec is not on my todo list... maybe just close this PR?
I'm shoving this under the "It works for me" carpet.

@rhamon
Copy link
Author

rhamon commented Aug 25, 2016

Regarding [].flatten, it returned unexpected results for me with array of arrays where Array() did correct thing... would be nice to prove the world using spec tests but see previous comment.

@roidelapluie
Copy link
Member

You can PR this to the oldpuppet branch, this branch should work with old puppet versions, then we can release a v3.0.1 and backport the changes to 4.0.1

@roidelapluie
Copy link
Member

Let's keep this PR open and I'll see if I find some time to work on that.

@rhamon
Copy link
Author

rhamon commented Aug 25, 2016

This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.

In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

For more information, please refer to http://unlicense.org

@rhamon
Copy link
Author

rhamon commented Aug 25, 2016

Merci RoiDeLapluie 👍

roidelapluie added a commit to roidelapluie/puppet-corosync that referenced this pull request Aug 31, 2016
Closes voxpupuli#291

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
roidelapluie added a commit to roidelapluie/puppet-corosync that referenced this pull request Aug 31, 2016
Closes voxpupuli#291

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
roidelapluie added a commit to roidelapluie/puppet-corosync that referenced this pull request Aug 31, 2016
Closes voxpupuli#291

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-feedback Further information is requested needs-work not ready to merge just yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants