Filter subnet by segment ID or None
In "_query_filter_by_fixed_ips_segment", the subnet query should be filtered by segment ID if exists, or None otherwise. The "segment_id" field (from the "subnet" DB register) is a string. As reported in the related bug, PostgreSQL does not accept to compare this field with a boolean value ("false"). This patch avoids the previous situation where the DB WHERE statement was trying to compare a string and a boolean: operator does not exist: character varying = boolean LINE 5: WHERE anon_1.subnets_segment_id = false No operator matches the given name and argument type(s). You might \ need to add explicit type casts. Change-Id: I1ff29eb45c6663885c2b8a126a3669e75b920c98 Closes-Bug: #1869034
This commit is contained in:
parent
890392a388
commit
79e8230e39
|
@ -393,8 +393,7 @@ class Subnet(base.NeutronDbObject):
|
|||
if 1 < len(segment_ids):
|
||||
raise segment_exc.FixedIpsSubnetsNotOnSameSegment()
|
||||
|
||||
segment_id = False if not segment_ids else segment_ids[0]
|
||||
|
||||
segment_id = None if not segment_ids else segment_ids[0]
|
||||
return query.filter(cls.db_model.segment_id == segment_id)
|
||||
|
||||
@classmethod
|
||||
|
|
Loading…
Reference in New Issue