File tree 2 files changed +13
-5
lines changed
2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change 56
56
} else {
57
57
$_refresh = true
58
58
}
59
+ $apt_update_successful = @(" ASH" /$)
60
+ for try in \$(seq ${apt::_update[' tries' ]} -1 1); do
61
+ timeout ${apt::_update[' timeout' ]} ${apt::provider} update && exit 0
62
+ [ \$try -eq 1 ] && exit \$?
63
+ sleep 1
64
+ done
65
+ - ASH
59
66
exec { 'apt_update' :
60
- command => " ${apt::provider} update" ,
67
+ command => " echo ${apt::provider} update FAILED " ,
61
68
loglevel => $apt::_update [' loglevel' ],
62
69
logoutput => ' on_failure' ,
70
+ path => ' /bin:/usr/bin' ,
71
+ provider => shell,
63
72
refreshonly => $_refresh,
73
+ returns => [-1], # This ensures a run-time failure.
64
74
timeout => $apt::_update [' timeout' ],
65
- tries => $apt::_update [' tries' ],
66
- try_sleep => 1,
75
+ unless => $apt_update_successful ,
67
76
}
68
77
}
Original file line number Diff line number Diff line change 267
267
268
268
it {
269
269
is_expected . to contain_exec ( 'apt_update' ) . with ( refreshonly : false ,
270
- timeout : 1 ,
271
- tries : 3 )
270
+ timeout : 1 )
272
271
}
273
272
end
274
273
You can’t perform that action at this time.
0 commit comments