File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
lib/puppet/provider/package Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -66,6 +66,7 @@ def hold
6666 Puppet . info ( "@property_hash = #{ @property_hash } " )
6767 Puppet . info ( "install_options = #{ @resource [ :install_options ] } " )
6868 modify_snap ( 'hold' ) if should_change_hold? ( @resource [ :install_options ] )
69+ @property_hash [ :mark ] = 'hold'
6970 end
7071
7172 def unhold
@@ -143,14 +144,16 @@ def should_change_hold?(options)
143144 should_hold_time = self . class . parse_time_from_options ( options )
144145 current_hold_time = @property_hash [ :hold_time ]
145146
147+ # if current hold time is nil we are fresh holding this snap
148+ return true if current_hold_time . nil?
149+
146150 parsed_hold_time = DateTime . parse ( current_hold_time )
147151 # If the hold time is more than 100 years, assume "forever"
148152 current_hold_time = 'forever' if ( parsed_hold_time - DateTime . now ) . to_i > 365 * 100
149153
150154 Puppet . info ( "should = #{ should_hold_time } , current = #{ current_hold_time } " )
151-
152- false if current_hold_time == should_hold_time
153- true
155+ Puppet . info ( "equal = #{ current_hold_time == should_hold_time } " )
156+ current_hold_time != should_hold_time
154157 end
155158
156159 def self . channel_from_options ( options )
You can’t perform that action at this time.
0 commit comments