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

pop() should work, argument errors #563

Open
explody opened this issue Feb 2, 2018 · 2 comments
Open

pop() should work, argument errors #563

explody opened this issue Feb 2, 2018 · 2 comments
Labels
Waiting on Contributor Awaiting on the person who raised this to update

Comments

@explody
Copy link
Contributor

explody commented Feb 2, 2018

Cookbook version

8.0.0

Chef-client version

>= 12.17

Platform Details

Ubuntu Trusty / Xenial

Scenario:

Use pop() methods in the various libraries.

Steps to Reproduce:

Try to pop a value out of a Nagios::Service, receive ArgumentError - wrong number of arguments (given 2, expected 1)

I'll note that pop() on Nagios::Host works as expected. The contents of the methods in the two classes is a bit different:

Service:

nagios/libraries/service.rb

Lines 199 to 206 in 8a909f2

def pop(obj)
return if obj == self
case obj
when Nagios::Servicegroup
if @servicegroups.keys?(obj.to_s)
pop_object(obj, @servicegroups)
pop(self, obj)
end

I can't see any way that L205 would work, and this is source of the exception

Compare to:

Host

nagios/libraries/host.rb

Lines 177 to 184 in 8a909f2

def pop(obj)
return if obj == self
case obj
when Nagios::Hostgroup
if @hostgroups.key?(obj.to_s)
pop_object(obj, @hostgroups)
obj.pop(self)
end

I have a PR available for this one too, but though it may warrant discussion in case my experience was unexpected.

@github-actions
Copy link

Marking stale due to inactivity. Remove stale label or comment or this will be closed in 7 days. Alternatively drop by the #sous-chefs channel on the Chef Community Slack and we'll be happy to help! Thanks, Sous-Chefs.

@github-actions github-actions bot added the Stale label Sep 30, 2020
@xorimabot xorimabot removed the Stale label Sep 30, 2020
@ramereth
Copy link
Contributor

ramereth commented Oct 4, 2020

@explody is this still an issue that needs to be addressed?

@ramereth ramereth added the Waiting on Contributor Awaiting on the person who raised this to update label Oct 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Waiting on Contributor Awaiting on the person who raised this to update
Projects
None yet
Development

No branches or pull requests

3 participants