Merge pull request #933 from coreos-inc/gcsqlfix

Fix issue with query when manifest count is 0
This commit is contained in:
josephschorr 2015-11-19 17:47:43 -05:00
commit aa1911fe15

View file

@ -148,10 +148,12 @@ def garbage_collect_tags(repo):
.join(RepositoryTag) .join(RepositoryTag)
.where(RepositoryTag.id << tags_to_delete)) .where(RepositoryTag.id << tags_to_delete))
num_deleted_manifests = (TagManifest num_deleted_manifests = 0
.delete() if len(manifests_to_delete) > 0:
.where(TagManifest.id << manifests_to_delete) num_deleted_manifests = (TagManifest
.execute()) .delete()
.where(TagManifest.id << manifests_to_delete)
.execute())
num_deleted_tags = (RepositoryTag num_deleted_tags = (RepositoryTag
.delete() .delete()