Jira (PUP-10643) hold => none not idempotent with dpkg provider

7 views
Skip to first unread message

Gabriel Nagy (Jira)

unread,
Aug 25, 2020, 8:20:03 AM8/25/20
to puppe...@googlegroups.com
Gabriel Nagy created an issue
 
Puppet / Bug PUP-10643
hold => none not idempotent with dpkg provider
Issue Type: Bug Bug
Assignee: Unassigned
Created: 2020/08/25 5:19 AM
Priority: Normal Normal
Reporter: Gabriel Nagy

Puppet Version: 6.18.0
Puppet Server Version: n/a
OS Name/Version: Debian/Ubuntu (any)

When explicitly specifying hold => none in a manifest, puppet will always report changes. Sample resource:

package { 'mc':
    ensure => present,
    mark   => none,
}

Desired Behavior:

Puppet should set mark to none and not report any subsequent changes.

Actual Behavior:

Puppet sets mark to none on each run.

----------------------------

Solved by the following patch:

--- a/lib/puppet/provider/package/dpkg.rb
+++ b/lib/puppet/provider/package/dpkg.rb
@@ -74,7 +74,7 @@ Puppet::Type.type(:package).provide :dpkg, :parent => Puppet::Provider::Package
       elsif ['config-files', 'half-installed', 'unpacked', 'half-configured'].include?(hash[:status])
         hash[:ensure] = :absent
       end
-      hash[:mark] = :hold if hash[:desired] == 'hold'
+      hash[:mark] = hash[:desired] == 'hold' ? :hold : :none
     else
       Puppet.debug("Failed to match dpkg-query line #{line.inspect}")
     end

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Gabriel Nagy (Jira)

unread,
Aug 25, 2020, 8:23:03 AM8/25/20
to puppe...@googlegroups.com
Gabriel Nagy updated an issue
Change By: Gabriel Nagy
*Puppet Version: 5.5.21/ 6.18.0*
*Puppet Server Version: n/a*
*OS Name/Version: Debian/Ubuntu (any)*


When explicitly specifying {{hold => none}} in a manifest, puppet will always report changes. Sample resource:
{code}package { 'mc':

    ensure => present,
    mark   => none,
}
{code}
*Desired Behavior:*


Puppet should set mark to none and not report any subsequent changes.

*Actual Behavior:*


Puppet sets mark to none on each run.

----------------------------

Solved by the following patch:
{code}--- a/lib/puppet/provider/package/dpkg.rb

+++ b/lib/puppet/provider/package/dpkg.rb
@@ -74,7 +74,7 @@ Puppet::Type.type(:package).provide :dpkg, :parent => Puppet::Provider::Package
       elsif ['config-files', 'half-installed', 'unpacked', 'half-configured'].include?(hash[:status])
         hash[:ensure] = :absent
       end
-      hash[:mark] = :hold if hash[:desired] == 'hold'
+      hash[:mark] = hash[:desired] == 'hold' ? :hold : :none
     else
       Puppet.debug("Failed to match dpkg-query line #{line.inspect}")
     end
{code}

Mihai Buzgau (Jira)

unread,
Aug 26, 2020, 3:57:04 AM8/26/20
to puppe...@googlegroups.com
Mihai Buzgau updated an issue
Change By: Mihai Buzgau
Sprint: PR NW - Triage 2020-09-01

Luchian Nemes (Jira)

unread,
Oct 13, 2020, 11:58:03 AM10/13/20
to puppe...@googlegroups.com
Luchian Nemes updated an issue
Change By: Luchian Nemes
Fix Version/s: PUP 6.19.0
Reply all
Reply to author
Forward
0 new messages