Skip to content

Commit

Permalink
fix: use LC_ALL=C.UTF-8 for subscription-manager (#3669)
Browse files Browse the repository at this point in the history
The default environment for "simple_command" includes LC_ALL=C, which
means ASCII (and not unicode); in case the language of the system is set
to a non-English locale that uses unicode characters (e.g. non-Latin1
languages), then subscription-manager will fail to output that with
encoding issues (e.g. [1]).

As a simple solution, enforce an unicode English locale for
subscription-manager, which should avoid those encoding issues.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=2074745

Signed-off-by: Pino Toscano <[email protected]>
  • Loading branch information
ptoscano authored Feb 2, 2023
1 parent 97b47dd commit 3cfcfc1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions insights/specs/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -600,8 +600,10 @@ class DefaultSpecs(Specs):
sshd_config = simple_file("/etc/ssh/sshd_config")
sshd_config_perms = simple_command("/bin/ls -lH /etc/ssh/sshd_config")
sssd_config = simple_file("/etc/sssd/sssd.conf")
subscription_manager_facts = simple_command("/usr/sbin/subscription-manager facts")
subscription_manager_id = simple_command("/usr/sbin/subscription-manager identity") # use "/usr/sbin" here, BZ#1690529
subscription_manager_facts = simple_command("/usr/sbin/subscription-manager facts",
override_env={"LC_ALL": "C.UTF-8"})
subscription_manager_id = simple_command("/usr/sbin/subscription-manager identity", # use "/usr/sbin" here, BZ#1690529
override_env={"LC_ALL": "C.UTF-8"})
subscription_manager_installed_product_ids = simple_command("/usr/bin/find /etc/pki/product-default/ /etc/pki/product/ -name '*pem' -exec rct cat-cert --no-content '{}' \;")
sudoers = glob_file(["/etc/sudoers", "/etc/sudoers.d/*"])
swift_object_expirer_conf = first_file(["/var/lib/config-data/puppet-generated/swift/etc/swift/object-expirer.conf", "/etc/swift/object-expirer.conf"])
Expand Down

0 comments on commit 3cfcfc1

Please sign in to comment.