David Schmitt <[email protected]> writes:
> Am 27.03.2010 09:04, schrieb Nigel Kersten:
>> On Sat, Mar 27, 2010 at 12:56 AM, David Schmitt<[email protected]> wrote:
>>> Am 26.03.2010 23:10, schrieb Nigel Kersten:
>>>>
>>>> @@ -47,9 +49,12 @@ Puppet::Type.type(:package).provide :dpkg, :parent =>
>>>> Puppet::Provider::Package
>>>>
>>>> if hash[:status] == 'not-installed'
>>>> hash[:ensure] = :purged
>>>> - elsif hash[:status] != "installed"
>>>> + elsif ['config-files', 'half-installed', 'unpacked',
>>>> 'half-configured'].include?(hash[:status])
>>>> hash[:ensure] = :absent
>>>> end
>>>> + if hash[:desired] == 'hold'
>>>> + hash[:ensure] = :held
>>>> + end
>>>
>>> I've never spent any thought on this, but reading this chunk, the question
>>> arose whether this is the right policy? Arguably, packages which are
>>> 'half-installed', 'unpacked', or 'half-configured' would still need some
>>> action to actually make them :absent, no?
>>
>> I had the same concern, but this is actually the same functionality as
>> before. Essentially all I've done is add a case for hold, explicitly
>> listed valid statuses, and now raise an error for an unknown status.
>>
>> The actual functionality of all states other than 'hold' should be
>> exactly the same as before, except unknown states will error.
>
> That's great for a bugfix, but I was trying to address a problem that both
> the original and your code exhibit. That might be worth another bug report +
> patch IFF my assumptions hold[1] and someone else agrees that this
config-files is more or less equivalent to absent; the package is gone, but
the configuration is still lying around in /etc for convenience. A new
install will work fine.
unpacked and half-installed are terrible: they signal a serious error in the
packaging system. You *might* get away with installing the package again, but
the odds that things don't work right are bad.
OTOH, without puppet having an explicit error state for packages "absent" is
probably the least-worst option, other perhaps than "do nothing to this".
Daniel
--
✣ Daniel Pittman ✉ [email protected] ☎ +61 401 155 707
♽ made with 100 percent post-consumer electrons
--
You received this message because you are subscribed to the Google Groups
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-dev?hl=en.