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

Update monit_validate_tests.rb #5

Merged
merged 1 commit into from
Jul 1, 2015
Merged

Update monit_validate_tests.rb #5

merged 1 commit into from
Jul 1, 2015

Conversation

MNiedzielski
Copy link
Contributor

Fixes the runtime messages:

[foo.bar.org] out: /home/ubuntu/puppet/modules/monit/lib/puppet/parser/functions/monit_validate_tests.rb:11: warning: already initialized constant RESOURCE_TESTS
[foo.bar.org] out: /home/ubuntu/puppet/modules/monit/lib/puppet/parser/functions/monit_validate_tests.rb:17: warning: already initialized constant RESOURCE_TESTS_OPERATORS
[foo.bar.org] out: /home/ubuntu/puppet/modules/monit/lib/puppet/parser/functions/monit_validate_tests.rb:23: warning: already initialized constant PROTOCOL_TESTS
[foo.bar.org] out: /home/ubuntu/puppet/modules/monit/lib/puppet/parser/functions/monit_validate_tests.rb:30: warning: already initialized constant TEST_TYPES
[foo.bar.org] out: /home/ubuntu/puppet/modules/monit/lib/puppet/parser/functions/monit_validate_tests.rb:42: warning: already initialized constant TEST_ACTIONS

Fixes the runtime messages:

[foo.bar.org] out: /home/ubuntu/puppet/modules/monit/lib/puppet/parser/functions/monit_validate_tests.rb:11: warning: already initialized constant RESOURCE_TESTS
[foo.bar.org] out: /home/ubuntu/puppet/modules/monit/lib/puppet/parser/functions/monit_validate_tests.rb:17: warning: already initialized constant RESOURCE_TESTS_OPERATORS
[foo.bar.org] out: /home/ubuntu/puppet/modules/monit/lib/puppet/parser/functions/monit_validate_tests.rb:23: warning: already initialized constant PROTOCOL_TESTS
[foo.bar.org] out: /home/ubuntu/puppet/modules/monit/lib/puppet/parser/functions/monit_validate_tests.rb:30: warning: already initialized constant TEST_TYPES
[foo.bar.org] out: /home/ubuntu/puppet/modules/monit/lib/puppet/parser/functions/monit_validate_tests.rb:42: warning: already initialized constant TEST_ACTIONS
jonhattan added a commit that referenced this pull request Jul 1, 2015
Update monit_validate_tests.rb
@jonhattan jonhattan merged commit f2ae9fd into sbitio:master Jul 1, 2015
@jonhattan
Copy link
Member

thanks!

@MNiedzielski
Copy link
Contributor Author

Thank you! I look forward to your updated release.

@jonhattan
Copy link
Member

This doesn't work for me in CentOS 6 / ruby 1.8.7 neither CentOS 7 / 2.0.0p598

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: uninitialized constant Puppet::Parser::Functions::RESOURCE_TESTS at /etc/puppet/environments/production/modules/monit/manifests/check/instance.pp:24 on node unipoln-side1.fujitsu

@NITEMAN
Copy link
Member

NITEMAN commented Jul 4, 2015

That construction seems incompatible with Ruby 1.8, I would try something like:

CONST = 2 unless defined? CONST

As suggested on http://stackoverflow.com/questions/10171978/check-if-a-constant-is-already-defined

jonhattan added a commit that referenced this pull request Jul 4, 2015
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.

3 participants