Use model_query() instead of session.query in db.*****_destroy

Bug #1256483 reported by ling-yun on 2013-11-30
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Wishlist
ling-yun

Bug Description

Use model_query() instead of session.query in db.volume_destroy, db.volume_type_destroy, db.transfer_destroy and db.snapshot_destroy.

ling-yun (zengyunling) on 2013-11-30
Changed in cinder:
assignee: nobody → ling-yun (zengyunling)
description: updated

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

Changed in cinder:
status: New → In Progress
Huang Zhiteng (zhiteng-huang) wrote :

I'm not a sqlalchemy expert. So pardon me if the answer is obvious: why using session.query() is considered a bug?

Reviewed: https://review.openstack.org/59257
Committed: http://github.com/openstack/cinder/commit/d54c49a22e3ce147003cc9a926b7b72e8dc9c1a8
Submitter: Jenkins
Branch: master

commit d54c49a22e3ce147003cc9a926b7b72e8dc9c1a8
Author: ling-yun <email address hidden>
Date: Sat Nov 30 17:09:28 2013 +0800

    Use model_query() in db.*****_destroy

    Use model_query() instead of session.query in db.volume_destroy,
    db.volume_type_destroy, db.transfer_destroy and db.snapshot_destroy as
    other methods use.
    model_query function is the query helper which is used in most part of
    cinder/db/sqlalchemy/api.py.

    Change-Id: I97be252df9d40bb97231e3341d5cedec26af2d93
    Closes-Bug: #1256483

Changed in cinder:
status: In Progress → Fix Committed
Thierry Carrez (ttx) on 2013-12-04
Changed in cinder:
milestone: none → icehouse-1
status: Fix Committed → Fix Released
ling-yun (zengyunling) wrote :

To huangzhiteng:
For code cleanup,model_query function is the query helper which is used in most part of
cinder/db/sqlalchemy/api.py.

Huang Zhiteng (zhiteng-huang) wrote :

So it's coding style issue, that it has nothing to do with function. Personal I wouldn't consider this kind of 'issue' as bug.

Changed in cinder:
importance: Undecided → Wishlist
Thierry Carrez (ttx) on 2014-04-17
Changed in cinder:
milestone: icehouse-1 → 2014.1
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers