Bug #2350
Aptitude Provider installs newest version when it can't find the specified one, also doesn't detect several errors
| Status: | Accepted | Start date: | 06/18/2009 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assignee: | - | % Done: | 0% |
|
| Category: | package | |||
| Target version: | 2.7.x | |||
| Affected Puppet version: | 0.24.8 | Branch: | ||
| Keywords: | aptitude provider package version | |||
| Votes: | 0 |
Description
While using the Aptitude provider, I found that if you specify a version that Aptitude can’t find, it tells you this but then just goes ahead and installs the latest version. I fixed this by making a dry run to install the package and then checking whether it could find it or not, throwing a Puppet error if it can’t find the version. The dry run is necessary, or else aptitude would install it before we can detect that the wrong version was installed.
On a related note, I also added extra stdout checks to look for cases of unmet dependencies and 404’s from the user’s sources. These are all problems I ran into when using the Aptitude provider.
With these fixes, the user is less likely to think that the package was installed when it wasn’t (due to uncaught errors), and will also be assured of what package version they are using. I’ve submitted my git patch. I originally did this in subversion (just started using git, total nub in that respect) based on puppet-latest.tgz (got 0.24.8), but figured a git patch would be more appropriate, so I forked + cloned lak/puppet/, made the changes there, and created the patch. I don’t have tests, but I’ve been using the puppet-latest.tgz-modified version on my production servers for the last month.
History
Updated by James Turnbull over 2 years ago
- Status changed from Unreviewed to Needs Decision
- Assignee set to Luke Kanies
- Target version set to 4
Luke – I don’t overly like the solution in the patch.
Updated by Luke Kanies over 2 years ago
- Status changed from Needs Decision to In Topic Branch Pending Review
- Assignee changed from Luke Kanies to James Turnbull
- Target version changed from 4 to 0.25.0
Updated by James Turnbull over 2 years ago
- Assignee changed from James Turnbull to Luke Kanies
Does this means you’re happy with this Luke?
Updated by Luke Kanies over 2 years ago
- Assignee deleted (
Luke Kanies)
James Turnbull wrote:
Does this means you’re happy with this Luke?
I’m happy with it if someone tests it. I’d like to see at least one person who heavily uses apt to test this.
Updated by James Turnbull over 2 years ago
- Target version changed from 0.25.0 to 2.6.0
Since no one has come forward to test this I am going to bump it.
Updated by Nigel Kersten over 2 years ago
Clarence, I’ll do some tests on Monday, but have you checked if the apt provider suffers from the same problem as the aptitude one in this regard?
Updated by James Turnbull about 2 years ago
- Status changed from In Topic Branch Pending Review to Needs More Information
Nigel/Clarence – any progress on this?
Updated by Nigel Kersten about 2 years ago
I completely forgot about it. I’ll try and get to it this week.
Updated by Nigel Kersten about 2 years ago
The apt.rb provider doesn’t suffer from this problem.
The aptitude patch looks ok to me, but I really don’t use aptitude at all with Puppet as I find it frustrating that it behaves differently to the apt provider.
Clarence, you should switch this to ready to checkin, or send the patch to the puppet-dev list for more eyeballs perhaps?
Updated by Nigel Kersten about 2 years ago
- Status changed from Needs More Information to Accepted
Updated by Clarence Tso about 2 years ago
Hey, sorry about that I’ve kind of been out of the loop. Nigel, I think James put it on puppet-dev a way while back in June, no feedback.
If there’s a way to systematically test this (and if it is necessary) and someone could point me in the direction I’d be happy to try writing them, though at the moment I don’t really know where to start. Thanks.
Updated by James Turnbull about 2 years ago
- Target version changed from 2.6.0 to 2.7.x