Impossible to execute storage tests selectively due to missing import

Bug #1265492 reported by Balazs Gibizer
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ceilometer
Fix Released
Undecided
Balazs Gibizer

Bug Description

Storage tests fail if they are executed selectively due to missing gettextutils import in ceilometer.storage.base.

$ tox -e py27 -- storage.test_storage_scenarios

...

FAIL: tests.storage.test_storage_scenarios.RawSampleTest.test_clear_metering_data_with_alarms(hbase)
tags: worker-1
----------------------------------------------------------------------
Empty attachments:
  pythonlogging:'ceilometer.openstack.common'

traceback-1: {{{
Traceback (most recent call last):
  File "ceilometer/tests/base.py", line 60, in skip_if_not_implemented
    return func(*args, **kwargs)
  File "/opt/stack/ceilometer/ceilometer/tests/storage/test_storage_scenarios.py", line 697, in test_clear_metering_data_with_alarms
    self.conn.create_alarm(alarm)
  File "ceilometer/storage/base.py", line 228, in create_alarm
    raise NotImplementedError(_('Alarms not implemented'))
NameError: global name '_' is not defined
}}}

...

Ran 430 (-88) tests in 11.444s (-3.566s)
FAILED (id=6, failures=64 (-46), skips=47)
error: testr failed (1)

$

Adding the missing import solves the problem:

diff --git a/ceilometer/storage/base.py b/ceilometer/storage/base.py
index 3ffbf17..dada7de 100644
--- a/ceilometer/storage/base.py
+++ b/ceilometer/storage/base.py
@@ -23,6 +23,7 @@ import datetime
 import math
 import six

+from ceilometer.openstack.common.gettextutils import _ # noqa
 from ceilometer.openstack.common import timeutils

Changed in ceilometer:
assignee: nobody → Balazs Gibizer (balazs-gibizer)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ceilometer (master)

Fix proposed to branch: master
Review: https://review.openstack.org/64667

Changed in ceilometer:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ceilometer (master)

Reviewed: https://review.openstack.org/64667
Committed: https://git.openstack.org/cgit/openstack/ceilometer/commit/?id=7e50fb53b950a8de2a3d84277d836293046af46e
Submitter: Jenkins
Branch: master

commit 7e50fb53b950a8de2a3d84277d836293046af46e
Author: Balazs Gibizer <email address hidden>
Date: Thu Jan 2 12:55:37 2014 +0100

    Add missing gettextutils import to ceilometer.storage.base

    Change-Id: I1cea5f9032ffceac72cd441da81f197e7f66448d
    Closes-Bug: #1265492

Changed in ceilometer:
status: In Progress → Fix Committed
gordon chung (chungg)
Changed in ceilometer:
milestone: none → icehouse-3
milestone: icehouse-3 → icehouse-2
Thierry Carrez (ttx)
Changed in ceilometer:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in ceilometer:
milestone: icehouse-2 → 2014.1
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.