fix bad slash migration

we're incorrectly looking at the column when debating whether to
reencode a resource.

Closes-Bug: #1662990
Change-Id: I84a78139ca6e5e049f70fd9c84033e60bc13e035
(cherry picked from commit f186f89a4b)
This commit is contained in:
gord chung 2017-02-08 18:10:00 +00:00 committed by gordon chung
parent 024ebe4776
commit 840888be19
1 changed files with 3 additions and 4 deletions

View File

@ -103,17 +103,16 @@ def upgrade():
for resource in connection.execute(resource_table.select()):
if resource_table.c.original_resource_id is None:
if resource.original_resource_id is None:
# statsd resource has no original_resource_id and is NULL
continue
try:
orig_as_uuid = uuid.UUID(
str(resource_table.c.original_resource_id))
orig_as_uuid = uuid.UUID(str(resource.original_resource_id))
except ValueError:
pass
else:
if orig_as_uuid == resource_table.c.id:
if orig_as_uuid == resource.id:
continue
new_original_resource_id = resource.original_resource_id.replace(