cinder test.py importing private module _lazy, that's bad

Bug #1408099 reported by John Griffith
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Critical
John Griffith
Juno
Fix Released
Critical
Jay Bryant
oslo.vmware
Fix Released
Critical
Doug Hellmann
Juno
Fix Committed
Critical
Adam Gandelman

Bug Description

We shouldn't be doing this anyway... and now there's a new version of oslo.i18n which exposes us for our trickery and causes unit tests to fail in a most excellent way.

Tags: gate-failure
tags: added: gate-failure
affects: ceilometer → cinder
Changed in cinder:
status: New → Triaged
importance: Undecided → Critical
assignee: nobody → John Griffith (john-griffith)
Changed in cinder:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/145359
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=894f20d9cf57b36ccf9a675c6b2b070d56c9b297
Submitter: Jenkins
Branch: master

commit 894f20d9cf57b36ccf9a675c6b2b070d56c9b297
Author: John Griffith <email address hidden>
Date: Tue Jan 6 14:40:00 2015 -0700

    Remove import of private _lazy module

    New version of oslo.i18n released and some things
    moved around (internal private modules in the lib).

    This should be fine and shouldn't matter to us, BUT
    it seems we had some hackery going on in our unit tests
    that were being lazy and importing and manipulating the
    private library.

    This patch removes those cases and fixed up the cinder.i18n
    helper method for enable_lazy to accept a bool (which is how
    the libraries method works to begin with).

    There were several tests in test_faults that were actually
    performing and comparing translations of messages. These
    tests aren't quite working now because they had a number
    of things they imported from private variables and methods
    in the i18n module. Honestly I'm not sure of the value of
    testing those things here anyway, but for now I've just
    added a skip to those and we can sort out long term fixes
    and plans later.

    Change-Id: I2ae3d9b98c107cebaf386adbdcdb3cfafee070be
    Partial-Bug: #1408099

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (stable/juno)

Fix proposed to branch: stable/juno
Review: https://review.openstack.org/145642

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: stable/juno
Review: https://review.openstack.org/146545

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on cinder (stable/juno)

Change abandoned by Jay Bryant (<email address hidden>) on branch: stable/juno
Review: https://review.openstack.org/146545
Reason: Have a solution that will work in https://review.openstack.org/#/c/145642

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Change abandoned by John Griffith (<email address hidden>) on branch: stable/juno
Review: https://review.openstack.org/145642

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Change abandoned by John Griffith (<email address hidden>) on branch: stable/juno
Review: https://review.openstack.org/145642
Reason: This is wrong now and rather than argue in the reviews and continue cycling I'm going to create a fresh backport

Revision history for this message
Adam Gandelman (gandelman-a) wrote :

Looks like oslo.vmware is also hitting the same issue on stable branches;

https://review.openstack.org/#/c/147154/

Changed in oslo.vmware:
status: New → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (stable/juno)

Reviewed: https://review.openstack.org/145642
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=3965a5f72984fabfa131ef5359a2959a80787a22
Submitter: Jenkins
Branch: stable/juno

commit 3965a5f72984fabfa131ef5359a2959a80787a22
Author: John Griffith <email address hidden>
Date: Tue Jan 6 14:40:00 2015 -0700

    Remove import of private _lazy module

    New version of oslo.i18n released and some things
    moved around (internal private modules in the lib).

    This should be fine and shouldn't matter to us, BUT
    it seems we had some hackery going on in our unit tests
    that were being lazy and importing and manipulating the
    private library.

    This patch removes those cases and fixed up the cinder.i18n
    helper method for enable_lazy to accept a bool (which is how
    the libraries method works to begin with).

    Note that this is not a cherry-pick from master but as based
    upon the commit below. There were enough differences between
    stable/juno and master that doing a cherry-pick didn't make sense.
    This change, instead, is the smallest set of changes we can safely
    do to handle the move to oslo i18n 1.3.0 or later.

    Partial-Bug: #1408099
    (inspired by commit 894f20d9cf57b36ccf9a675c6b2b070d56c9b297)

    Change-Id: I2ae3d9b98c107cebaf386adbdcdb3cfafee070be

tags: added: in-stable-juno
Alan Pevec (apevec)
Changed in oslo.vmware:
importance: Undecided → Critical
tags: removed: in-stable-juno
Changed in oslo.vmware:
assignee: nobody → Doug Hellmann (doug-hellmann)
Alan Pevec (apevec)
Changed in cinder:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/146763
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=5be6971908d1d63f89c3b1e58963b161e4555315
Submitter: Jenkins
Branch: master

commit 5be6971908d1d63f89c3b1e58963b161e4555315
Author: Jay S. Bryant <email address hidden>
Date: Mon Jan 12 22:55:45 2015 -0600

    Ensure lazy translation is disabled properly

    Commit 894f20d9cf57b36ccf9a675c6b2b070d56c9b297 changed the way that
    enable_lazy() is being configured in cinder's test cases. The changes
    were required to remove the use of _lazy from the oslo's i18n library.
    _lazy was removed from i18n and the code that was accessing the internal
    variable broke. The commit referenced above made changes to remove
    the use of _lazy.

    The commit, however, changed the behavior of the test cases to only
    enable_lazy without disabling it, which diverges from the original
    behavior.

    This commit uses the new oslo.i18n ToggleLazy fixture (added in 1.3.0).

    Closes-bug: 1408099
    Change-Id: If9530b2bb8f0f511ccff4527ea9f2d13f7103bdb

Changed in oslo.vmware:
milestone: none → 0.9.0
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in cinder:
milestone: none → kilo-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in cinder:
milestone: kilo-2 → 2015.1.0
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.