Merge "Postgres does not like empty strings for type inet"

This commit is contained in:
Jenkins 2013-02-02 12:40:40 +00:00 committed by Gerrit Code Review
commit 55b59008ae

View File

@ -890,6 +890,11 @@ def floating_ip_get_by_address(context, address):
@require_context
def _floating_ip_get_by_address(context, address, session=None):
# if address string is empty explicitly set it to None
if not address:
address = None
result = model_query(context, models.FloatingIp, session=session).\
filter_by(address=address).\
first()