Avoid using locals() with formatting strings.

Bug #1190748 reported by Andrew Forrest
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Undecided
Scott DAngelo

Bug Description

Cinder source code contains numerous cases of using "locals()" to supply values to formatting strings.

This practice has been prohibited in the "Cinder Style Commandments "(https://github.com/openstack/cinder/blob/master/HACKING.rst).

This bug report is to allow tracking of the work to correct the matter.

See also: this bug filed against nova: https://bugs.launchpad.net/nova/+bug/1171936

Changed in cinder:
assignee: nobody → Scott DAngleo (scott-dangelo)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

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

Changed in cinder:
assignee: Scott DAngleo (scott-dangelo) → Andrew Forrest (forrest-r)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

Revision history for this message
Haomai Wang (haomai) wrote :

There is a duplicate bug report
https://bugs.launchpad.net/cinder/+bug/1171936

Revision history for this message
Andrew Forrest (forrest-r) wrote :

I sought some advice from my colleagues about opening this bug or just using #1171936 (which is cited in this bug's description) and the advice was to open the bug.

At the time #1171936 was reported against nova only and the idea of tracking the activity for cinder separately as well as the rationale of Cinder Style Commandment violations seemed to weigh in favor of that.

I note that launchpad allows "multiproject bugs" but there is not much OpenStack guidance on their use (that I could find).

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

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

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

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/33165
Committed: http://github.com/openstack/cinder/commit/77be2761dc4407fd8aa292a2ee4bb9df6dccd31d
Submitter: Jenkins
Branch: master

commit 77be2761dc4407fd8aa292a2ee4bb9df6dccd31d
Author: Andrew Forrest <email address hidden>
Date: Sat Jun 15 11:09:33 2013 -0700

    cinder/.: replace 'locals()' with explicit values

    Help bring source code into compliance with the Cinder Style Commandments:
    https://github.com/openstack/cinder/blob/master/HACKING.rst

    This change covers all affected source directly in the top-level directory
    of the cinder module, i.e. cinder/*.py

    Partially fixes: bug #1190748

    Change-Id: Ice5efc5eda7189969af6a9b722344fad7aa49ff0

Changed in cinder:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/33288
Committed: http://github.com/openstack/cinder/commit/8cb79dd1278b604e2f0f26216b9add71ecdca904
Submitter: Jenkins
Branch: master

commit 8cb79dd1278b604e2f0f26216b9add71ecdca904
Author: Andrew Forrest <email address hidden>
Date: Sat Jun 15 11:45:15 2013 -0700

    cinder.schedule: Replace 'locals()' with explicit values

    Help bring source code into compliance with the Cinder Style Commandments:
    https://github.com/openstack/cinder/blob/master/HACKING.rst

    This change covers all affected source in the cinder scheduler module, i.e.
    cinder/scheduler/*.py and subdirectories.

    Partially fixes: bug #1190748

    Change-Id: I75ad858ee62317bef6c59b9c0896f8a94a989d52

Revision history for this message
Scott DAngelo (scott-dangelo) wrote :

I corresponded with Andrew. He stated that I could perform some of the work on this bug, namely for:
cinder/brick
cinder/db
cinder/image
cinder/tests

I've re-assigned to myself.

Changed in cinder:
assignee: Andrew Forrest (forrest-r) → Scott DAngleo (scott-dangelo)
status: Fix Committed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

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

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

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/33146
Committed: http://github.com/openstack/cinder/commit/6005677a9e54c11418401398f6074769a1310767
Submitter: Jenkins
Branch: master

commit 6005677a9e54c11418401398f6074769a1310767
Author: Andrew Forrest <email address hidden>
Date: Fri Jun 14 17:09:53 2013 -0700

    cinder.backup: Replace 'locals()' with explicit values

    Help bring source code into compliance with the Cinder Style Commandments:
    https://github.com/openstack/cinder/blob/master/HACKING.rst

    This change covers all affected source in the cinder backup module, i.e.
    cinder/backup/*.py and subdirectories.

    Partially fixes: bug #1190748

    Change-Id: I3e0f3806030f1813d055135f15e64b5a719970ed

Changed in cinder:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in cinder:
milestone: none → havana-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in cinder:
milestone: havana-2 → 2013.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.