Archlinux locale configuration broken

Bug #1402406 reported by troy engel on 2014-12-14
This bug affects 5 people
Affects Status Importance Assigned to Milestone

Bug Description

The method for configuring the locale information for Arch is incorrect; it's writing "LANG=lang.CP CP" to /etc/locale.gen which should just be "lang.CP CP" (no foo=bar) as a naked line. The LANG= is to be written to /etc/locale.conf instead.

Provider (Rackspace) generated config value:

# grep ^locale /etc/cloud/cloud.cfg.d/10_rackspace.cfg
locale: en_US.UTF-8 UTF-8

== Existing code ==

# cat /etc/locale.gen
# Created by cloud-init v. 0.7.6 on Sun, 14 Dec 2014 15:23:26 +0000
LANG="en_US.UTF-8 UTF-8"

# locale-gen
Generating locales...
  LANG="en_US.UTF-8"...character map file `UTF-8"' not found: No such file or directory
cannot open locale definition file `LANG="en_US': No such file or directory

== Manually fixed ==

# cat /etc/locale.gen
# Created by cloud-init v. 0.7.6 on Sun, 14 Dec 2014 15:23:26 +0000
en_US.UTF-8 UTF-8

# locale-gen
Generating locales...
  en_US.UTF-8... done
Generation complete.


The attached patch takes a stab at correcting, however I'm not a Python coder so YMMV. Based on the existing code, it seems to be expected the Provider always specify "lang.CP CP" for 'locale' in the cloud.cfg file(s) so this patch is based on that expectation, using split() looking for the space and peeling off the first element for /etc/locale.conf setup.

troy engel (troyengel) wrote :
Joshua Powers (powersj) on 2017-09-11
tags: added: arch
Changed in cloud-init:
status: New → Confirmed
importance: Undecided → Medium

Downstream (Arch) asked me to ping this bug, it is still valid.

James Falcon (falcojr) wrote :
Changed in cloud-init:
status: Confirmed → Fix Committed

This bug is believed to be fixed in cloud-init in version 21.2. If this is still a problem for you, please make a comment and set the state back to New

Thank you.

Changed in cloud-init:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers