__package_yum is locale-dependent; should not #190
Labels
No Label
bugfix
cleanup
discussion
documentation
doing
done
feature
improvement
packaging
Stale
testing
TODO
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: ungleich-public/cdist#190
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Created by: jonmz
cdist/conf/type/__package_yum/gencode-remote
tries to detect the current state of a package by looking for the string "no package provides" in the output ofrpm -q --whatprovides
:But this effectively fails if the system in question is providing its output in another language:
As as result, having
__package pssh --state present
in a manifest in fact doesn't install the package because the missing "no package provides" output leads to the false assumption that the package in question is installed. cdist succeeds with "Finished successful run".Even if the target host is set to
en_US
, manysshd_config
s haveAcceptEnv LANG
set (e.g. CentOS 6 by default), so the functionality of __package_yum effectively depends on the language configuration of the client running cdist which doesn't seem like a good idea at all.Is there any reason why the check doesn't simply check the exit code of the rpm call?
I've seen other explorers like __package_apt also rely on output like "Status: install ok installed" from dpkg which might be also locale-dependent.
closed
Created by: telmich
I think wherever possible, we should stick to the return code.
However, if I remember correctly the *bsd package managers do not provide us with sensible return codes (i.e. always exit 0).
I think where possible, we should change to the return code and in all other cases setup the locale to C.
@asteven Comments?