Puppet: System Administration Automated

Support

Ticket #711 (closed defect: fixed)

Opened 1 year ago

Last modified 1 year ago

Apt provider does not purge very well

Reported by: luke Assigned to: mpalmer
Priority: normal Milestone: beaker
Component: library Version: 0.23.0
Severity: normal Keywords: package,purge,apt
Cc: Triage Stage: Accepted
Attached Patches: None Complexity: Unknown

Description

When you use the apt provider to purge, you get purges every time because the current value is returned as 'absent' instead of 'purged':

debug: package provider apt: Executing '/usr/bin/dpkg-query -W --showformat '${Status} ${Package} ${Version}\n''
debug: /ralsh/Package[hello]: Changing ensure
debug: /ralsh/Package[hello]: 1 change(s)
debug: /ralsh/Package[hello]/ensure: setting purged (currently absent)
debug: package provider apt: Executing '/usr/bin/apt-get -y -q remove --purge hello'
notice: /ralsh/Package[hello]/ensure: created

Note the lame log, too -- that log message needs to be extended to support notifying on purge, rather than just "if it's not absent, it was installed".

Attachments

apt.patch (1.3 kB) - added by DavidS on 07/14/07 12:28:47.
workaround small apt bug and correctly interpret dpkg-query output

Change History

07/07/07 01:50:28 changed by mpalmer

I'm going to ask you what you ask everyone else: are you sure you don't have some older version of Puppet chasing around somewhere? Because I fixed this bug (or else it's identical twin brother) a while ago -- bug #644, fixed in r2537. If you're sure you don't have some 0.22 laying about, I guess it's time to fire up the test case again.

07/08/07 18:20:06 changed by luke

Yep, I'm confident I don't have old versions sitting around. Annoyingly, the test case you made for #644 passes just fine.

I expect the problem in this case is prefetching -- all package providers now have their instances() class method called, which returns a list of provider instances with the current state in a @property_hash variable. My guess is that this hash has :absent when it should have :purged, so I undid the work you did in [2537] to some extent.

07/09/07 00:06:54 changed by mpalmer

  • owner changed from luke to mpalmer.
  • status changed from new to assigned.

Very strange. Time for another test case, I guess.

07/14/07 12:28:47 changed by DavidS

  • attachment apt.patch added.

workaround small apt bug and correctly interpret dpkg-query output

07/14/07 12:34:43 changed by DavidS

I found another corner case where the apt provider misbehaves. The attached patch fixes

  • a misinterpretation of dpkg-query output: not-installed means purged, not absent

and

07/19/07 01:49:17 changed by luke

  • status changed from assigned to closed.
  • resolution set to fixed.

Patch applied in [2708].