From 50b9599e1819ee26ee277a918285b37b64dd309d Mon Sep 17 00:00:00 2001 From: Maurice Schreiber Date: Fri, 10 Aug 2018 15:43:38 +0200 Subject: [PATCH] Fix ShareGroup sqlalchemy model ShareGroupTypes relation. Query for deleted must look for 'False'. Fixes manila manage db purge. Closes-Bug: #1786769 Change-Id: I6d9966b257553749f73993e6d63951747131b570 (cherry picked from commit 4b8adbb8059259f9d99f28822bd2f09b75071e54) --- manila/db/sqlalchemy/models.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/manila/db/sqlalchemy/models.py b/manila/db/sqlalchemy/models.py index b6e12827b9..d3f28382b3 100644 --- a/manila/db/sqlalchemy/models.py +++ b/manila/db/sqlalchemy/models.py @@ -1085,10 +1085,10 @@ class ShareGroup(BASE, ManilaBase): ShareGroupTypes, backref="share_groups", foreign_keys=share_group_type_id, - primaryjoin='and_(' - 'ShareGroup.share_group_type_id == ' - 'ShareGroupTypes.id,' - 'ShareGroup.deleted == 0)') + primaryjoin="and_(" + "ShareGroup.share_group_type_id ==" + "ShareGroupTypes.id," + "ShareGroup.deleted == 'False')") _availability_zone = orm.relationship( "AvailabilityZone", lazy='immediate',