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

ensure => absent fails on el5/el6 if net-snmp-utils is installed #20

Closed
jhoblitt opened this issue Sep 3, 2014 · 9 comments
Closed
Assignees
Labels
enhancement New feature or request

Comments

@jhoblitt
Copy link
Member

jhoblitt commented Sep 3, 2014

This module is able to install net-snmp-utils on el{56}.x by setting install_client => true but won't uninstall via ensure => absent unless install_client => true is also set. Eg.

Execution of '/bin/rpm -e net-snmp-5.3.2.2-17.el5_8.1.x86_64' returned 1: error: Failed dependencies: net-snmp = 1:5.3.2.2-17.el5_8.1 is needed by (installed) net-snmp-utils-5.3.2.2-17.el5_8.1.x86_64

This is a minor nitpick but I find the parameter misleading. Perhaps manage_client would be more intutive? Or would it make sense for ensure => absent to explicity set the same on snmp::client?

@razorsedge
Copy link
Contributor

I will have to dig into this. I might lean toward ensure => absent propagating to snmp::client.

I am not happy that package { 'foo': ensure => present } runs yum while package { 'foo': ensure => absent } runs rpm.

@jhoblitt
Copy link
Member Author

jhoblitt commented Sep 5, 2014

The logic behind that is that yum will try to remove everything that
depends that package where as rpm removes just the package. Yum's
behavior is better in this instance but is known to cause breakage by
being over zealous. Eg., uninstalling all of gnome because you want to
remove cups.

I think there may be a way to force it to use yum for the removal but
it's been awhile since I've looked at the code for that type.

@razorsedge razorsedge added the enhancement New feature or request label Sep 14, 2014
razorsedge added a commit that referenced this issue Oct 6, 2014
@razorsedge
Copy link
Contributor

@jhoblitt How does aa6755a look?

@jhoblitt
Copy link
Member Author

jhoblitt commented Oct 6, 2014

👍 This looks great / much less confusing.

@razorsedge
Copy link
Contributor

@jhoblitt You wouldn't happen to know how to test the Puppet warning function in rspec would you?

This just does not work in rspec-puppet:

it { should contain_warning('snmp: parameter install_client is deprecated; please use manage_client')}

@jhoblitt
Copy link
Member Author

jhoblitt commented Oct 6, 2014

Unfortunately, you can't test if a function call happened that way because the contain_* methods inspect the state of the generated catalog (which only contains resources). The only solution I've come up with for warnings is to look for the string in the stderr with rspec-system/beaker. Eg: https://github.com/puppetlabs/puppetlabs-concat/blob/master/spec/acceptance/deprecation_warnings_spec.rb

@razorsedge
Copy link
Contributor

Ah, yes. That makes sense now. I keep getting client catalog confused with server-side stuff.

@razorsedge razorsedge self-assigned this Oct 7, 2014
@razorsedge
Copy link
Contributor

This ships in Forge release 3.2.0.

@jhoblitt
Copy link
Member Author

jhoblitt commented Oct 7, 2014

Fabulous!

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

No branches or pull requests

2 participants