Avoid using locals() with formatting strings.

Bug #1190748 reported by Andrew Forrest on 2013-06-13
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
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)

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

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

Haomai Wang (haomai) wrote :

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

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).

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

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

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

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

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

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

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) on 2013-07-17
Changed in cinder:
milestone: none → havana-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2013-10-17
Changed in cinder:
milestone: havana-2 → 2013.2
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers