translation not available in loguserdata.py

Bug #1325313 reported by Mike Spreitzer
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Critical
Thomas Herve

Bug Description

heat/cloudinit/loguserdata.py is not run in the heat engine, it is run in the instance --- where the translation function (_) is not available.

For example, when the instance is of a Fedora 20 image, the startup fails with log output like this:

[ 80.223512] cloud-init[614]: Cloud-init v. 0.7.2 running 'modules:final' at Sun, 01 Jun 2014 04:13:08 +0000. Up 80.02 seconds.
[ 80.697879] cloud-init[614]: Traceback (most recent call last):
[ 80.706124] cloud-init[614]: File "/var/lib/cloud/instance/scripts/loguserdata.py", line 92, in <module>
[ 80.726154] cloud-init[614]: code = main()
[ 80.736869] cloud-init[614]: File "/var/lib/cloud/instance/scripts/loguserdata.py", line 82, in main
[ 80.753938] cloud-init[614]: LOG.info(_('Provision began: %s'), datetime.datetime.now())
[ 80.768140] cloud-init[614]: NameError: global name '_' is not defined
[ 80.780226] cloud-init[614]: 2014-06-01 04:13:09,642 - util.py[WARNING]: Failed running /var/lib/cloud/instance/scripts/loguserdata.py [1]
[ 80.821810] cloud-init[614]: 2014-06-01 04:13:09,682 - cc_scripts_user.py[WARNING]: Failed to run module scripts-user (scripts in /var/lib/cloud/instance/scripts)
[ 80.834784] cloud-init[614]: 2014-06-01 04:13:09,684 - util.py[WARNING]: Running scripts-user (<module 'cloudinit.config.cc_scripts_user' from '/usr/lib/python2.7/site-packages/cloudinit/config/cc_scripts_user.pyc'>) failed
[ 81.233593] cloud-init[614]: Cloud-init v. 0.7.2 finished at Sun, 01 Jun 2014 04:13:10 +0000. Datasource DataSourceConfigDriveNet [net,ver=2][source=/dev/sr0]. Up 81.20 seconds

Revision history for this message
Mike Spreitzer (mike-spreitzer) wrote :

It looks like https://review.openstack.org/#/c/94217/ was a little over-ambitious.

Revision history for this message
Mike Spreitzer (mike-spreitzer) wrote :

When I remove all the uses of "_" from loguserdata.py then the Fedora 20 images startup without a problem.

The image I have been testing with is http://cloud.fedoraproject.org/fedora-20.x86_64.qcow2
with MD5 = 1ec332a350e0a839f03c967c1c568623

Revision history for this message
Thomas Herve (therve) wrote :
Changed in heat:
importance: Undecided → High
assignee: nobody → Thomas Herve (therve)
milestone: none → juno-1
status: New → In Progress
Revision history for this message
Steve Baker (steve-stevebaker) wrote :

Marking critical, this broke the heat-slow job

Changed in heat:
importance: High → Critical
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

Reviewed: https://review.openstack.org/96747
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=db515c54cf40e062ba05d9bdddec256831256903
Submitter: Jenkins
Branch: master

commit db515c54cf40e062ba05d9bdddec256831256903
Author: Thomas Herve <email address hidden>
Date: Fri May 30 14:34:35 2014 +0200

    Remove translation from loguserdata

    The logs in loguserdata don't need to be translated because it's sent
    with the po files to instances, and actually break because of gettext
    not being used

    Closes-Bug: #1325313
    Change-Id: I365f3d882b8f64f9710eea4901ac266f9fcf0da3

Changed in heat:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in heat:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in heat:
milestone: juno-1 → 2014.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.