Skip to content

Commit

Permalink
Merge pull request #1 from thgrs/master
Browse files Browse the repository at this point in the history
list projects with only deleted volumes as well
  • Loading branch information
arnewiebalck authored Mar 1, 2018
2 parents bfa1330 + 2bdc9ca commit 410b861
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 410b861

Please sign in to comment.