Skip to content

Commit

Permalink
list projects with only deleted volumes as well
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Graichen committed Mar 1, 2018
1 parent bfa1330 commit 2bdc9ca
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions cinder-quota-sync
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,9 @@ def get_projects(meta):

projects = []
volumes_t = Table('volumes', meta, autoload=True)
volumes_q = select(columns=[volumes_t.c.project_id,
func.count()],
whereclause=and_(volumes_t.c.deleted == 0),
group_by=volumes_t.c.project_id)
for (project, _) in volumes_q.execute():
projects.append(project)
volumes_q = select(columns=[volumes_t.c.project_id]). group_by(volumes_t.c.project_id)
for project in volumes_q.execute():
projects.append(project[0])

return projects

Expand Down

0 comments on commit 2bdc9ca

Please sign in to comment.