-
Notifications
You must be signed in to change notification settings - Fork 461
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
MODULES-10543: remove sources.list file on purging #904
Conversation
The current sources.list purge behavior is inconsistent with the preferences behavior. The former creates a file with a comment, the latter removes the file. This harmonizes this behavior between the two files and simply drops the file if it is to be purged.
tests have failed but that's not because of this patch, at least i hope not: https://travis-ci.org/puppetlabs/puppetlabs-apt/jobs/649004533 the error is:
i would argue strongly against using keyservers, as they do stuff like that, but what do i know... ;) |
This makes a lot of sense to me. Thanks @anarcat for that patch! |
Codecov Report
@@ Coverage Diff @@
## master #904 +/- ##
=======================================
Coverage 73.07% 73.07%
=======================================
Files 5 5
Lines 260 260
=======================================
Hits 190 190
Misses 70 70 Continue to review full report at Codecov.
|
trying to restart travis again again. |
tests are now passing. i opened a bug report in JIRA about that problem as well: |
Hi @anarcat Thank you for your contribution, this look great. |
Hi @anarcat , Thanks |
hi @petak-it i think if you have something competing with Puppet to recreate the file, you have two options:
My patch did not force purging the file. It just changed the effect of the Furthermore, if Finally, if you see a bug in this module, the right way to report it is not in a comment in a pull request. It's in JIRA, at https://tickets.puppetlabs.com/ I hope that helps |
I can confirm that after upgrading to this latest release of puppetlabs-apt that we are seeing Puppet run these twice per day on our Ubuntu 18.04 LTS fleet:
This post sheds light on the handful of Ubuntu services that are recreating /etc/apt/sources.list as an empty zero byte file, and the post also illustrates the headache involved in disabling these services: I would like to propose that the intent of 'purge' with regards to sources.list is akin to "purging any Apt sources out of sources.list" rather than deleting the file from the system. If we modify this module so that 'purge' doesn't delete the sources.list file but instead ensures that it's zero bytes, then it will play nice with the various Ubuntu tools that rely on this file existing while still "purging any Apt sources out of sources.list". I would be happy to code this and submit a Pull Request. |
We will revert the changes and get a new PR for this feature in which we will keep the previous default behaviour of creating an empty file while purging. |
The current sources.list purge behavior is inconsistent with the
preferences behavior. The former creates a file with a comment, the
latter removes the file.
This harmonizes this behavior between the two files and simply drops
the file if it is to be purged.