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

Bug #1256483 reported by ling-yun
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
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)
Changed in cinder:
assignee: nobody → ling-yun (zengyunling)
description: updated
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/59257

Changed in cinder:
status: New → In Progress
Revision history for this message
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?

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

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)
Changed in cinder:
milestone: none → icehouse-1
status: Fix Committed → Fix Released
Revision history for this message
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.

Revision history for this message
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
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (stable/havana)

Fix proposed to branch: stable/havana
Review: https://review.openstack.org/64083

Thierry Carrez (ttx)
Changed in cinder:
milestone: icehouse-1 → 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.