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

add guard for old package removal #247

Merged
merged 1 commit into from Oct 27, 2015

Conversation

Projects
None yet
2 participants
@dwradcliffe
Copy link
Contributor

dwradcliffe commented Oct 24, 2015

This will skip the removal of the datadog-agent-base package if it is not installed.
Due to how chef checks to see if a package is installed, and the fact that this package is a virtual package, chef always tries to uninstall the package even if it is not installed.

@miketheman

This comment has been minimized.

Copy link
Collaborator

miketheman commented Oct 24, 2015

Hi there!
Thanks for taking the time to report this.
We will be removing the package removal on the next major version of the
cookbook, as it served a transitional purpose for the pre-version-5 Agent
installs.
The guard added is apt-specific, and likely would not work on rpm-based
installs.

Is there a better guard that you might come up with?

On Fri, Oct 23, 2015, 22:59 David Radcliffe notifications@github.com
wrote:

This will skip the removal of the datadog-agent-base package if it is not
installed.
Due to how chef checks to see if a package is installed
https://github.com/chef/chef/blob/8bf1304da739d4be94edb101ad9e46c96b1d4ccd/lib/chef/provider/package/apt.rb#L79-L97,
and the fact that this package is a virtual package, chef always tries to

uninstall the package even if it is not installed.

You can view, comment on, or merge this pull request online at:

#247
Commit Summary

  • add guard for old package removal

File Changes

Patch Links:


Reply to this email directly or view it on GitHub
#247.

@dwradcliffe dwradcliffe force-pushed the dwradcliffe:patch-2 branch from 1cb04d4 to f09df64 Oct 25, 2015

@dwradcliffe

This comment has been minimized.

Copy link
Contributor Author

dwradcliffe commented Oct 25, 2015

Added guards for both platform families. Also fixed the specs so they should pass now.

@miketheman

This comment has been minimized.

Copy link
Collaborator

miketheman commented Oct 26, 2015

@dwradcliffe Thanks! The specs aren't being run due to style failures. These can be run locally when running rake in the root of the repo.

Honestly, this seems like a failing of Chef, if it's not doing the right thing in the case of a virtual package.

@dwradcliffe

This comment has been minimized.

Copy link
Contributor Author

dwradcliffe commented Oct 26, 2015

I agree, but after looking at the code I didn't see an easy path forward that doesn't break existing functionality on that end. I was hoping to take a simpler short cut. How long until this resource is removed entirely?

add guard for old package removal
This will skip the removal of the `datadog-agent-base` package if it is not installed.
Due to how chef checks to see if a package is installed, and the fact that this package is a virtual package, chef always tries to uninstall the package even if it is not installed.

@dwradcliffe dwradcliffe force-pushed the dwradcliffe:patch-2 branch from f09df64 to 6253bc0 Oct 26, 2015

@dwradcliffe

This comment has been minimized.

Copy link
Contributor Author

dwradcliffe commented Oct 26, 2015

Style tests fixed

@miketheman miketheman added the optimize label Oct 27, 2015

@miketheman miketheman added this to the 2.2.0 milestone Oct 27, 2015

@miketheman miketheman self-assigned this Oct 27, 2015

@miketheman

This comment has been minimized.

Copy link
Collaborator

miketheman commented Oct 27, 2015

Thanks @dwradcliffe!

miketheman added a commit that referenced this pull request Oct 27, 2015

Merge pull request #247 from dwradcliffe/patch-2
add guard for old package removal

@miketheman miketheman merged commit e1ddf2e into DataDog:master Oct 27, 2015

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls First build on master at 100.0%
Details

@dwradcliffe dwradcliffe deleted the dwradcliffe:patch-2 branch Nov 22, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.