py34: fix comparision NoneType and int

error was:
TypeError: unorderable types: NoneType() > int()

Change-Id: I418204ee0da15d78074bbdbe3e4e7e0fe9e933a1
This commit is contained in:
Andrey Pavlov 2015-09-09 10:13:39 +03:00
parent d30e88d02b
commit 7a04b3a5ac

View File

@ -87,6 +87,8 @@ def create_network_interface(context, subnet_id,
fixed_ips.append({'ip_address': str(ip_address)})
if not fixed_ips and not secondary_private_ip_address_count:
secondary_private_ip_address_count = 1
if secondary_private_ip_address_count is None:
secondary_private_ip_address_count = 0
if secondary_private_ip_address_count > 0:
for _i in range(secondary_private_ip_address_count):
fixed_ips.append({'subnet_id': os_subnet['id']})