If glance backend database is not MySQL or postgreSQL,the unique
constraint of image-member only includes image-id and member.
If then an image-member is deleted, then create it again with the
same parameters, glance initiates a query to check if there is
already an existing one, but the result doesn't include the record
which was marked as deleted, glance will try to create a new one
with the same parameters, it will fail with SQL0803N error. To fix
this,we should check all existing image-member records including
the deleted image-member before create image-member, then update it
if it exists, otherwise create a new one.
APIImpact
Closes-Bug: #1462315
Implements: bp reuse-the-deleted-image-member
Change-Id: I84f88d133bf4ac6daa0ff5d148aed86c0ff2cb2d