-
-
Notifications
You must be signed in to change notification settings - Fork 500
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
fix purge rabbitmq_parameter #945
Conversation
`resource[:component_name]` is set on creation (`ensure => present`) and deletion (`ensure => absent`) of the rabbitmq_parameter type but it is not set when it's removed from puppet-purge. On the other hand, `component_name` is set to absent on creation, is set on deletion and on purge. ``` resource[:component_name] component_name creation shovel :absent deletion shovel shovel purge nil shovel ``` When deleting a parameter, replace `resource[:component_name']` with `resource[:component_name] || component_name`
54a16fb
to
c7ff86a
Compare
Is there a way to test this in the unit tests somehow? |
I don't know ... I think so but it's beyond my knowledge to be honest, from the state of the variable in each case, the fix should be to replace from my understanding on the other hand, I'd like to make the test better, but I don't have time nor a good knowledge of puppet tests. |
So I'm not against adding this without unit tests, but I would like to understand the problem a bit better. When I try just adjusting
which makes me think that value is getting set to Having the acceptance tests crash on me locally, but trying to see in #946 if that test passes or fails; I can also merge that if it is successful. |
ps - asking on IRC if someone can take a look at this; that may be another good place to get some help with all of this. |
https://github.com/voxpupuli/puppet-rabbitmq/actions/runs/6669554996/job/18127694532?pr=946
where that value is empty. I have the acceptance tests running again locally (this can be a good quick way to test this kind of thing), so I'll see if one or both changes fixes this in the acceptance tests; if so, we can try to figure out how to make the existing unit test better. |
I verified that the test from #946 fails without this change (proving the bug exists), and passes with either change (with or without the |
Pull Request (PR) description
resource[:component_name]
is set on creation (ensure => present
) and deletion (ensure => absent
) of the rabbitmq_parameter type but it is not set when it's removed from puppet-purge.On the other hand,
component_name
is set to absent on creation, is set on deletion and on purge.When deleting a parameter, replace
resource[:component_name']
withresource[:component_name] || component_name
.this bug was introduced by #833 (for #832)