Clarify static route requirements check

Some static route verification was added in commit
894e0c4dc9, but reviewers requested a more
simplified check for the necessary elements.

This change clarifies the conditional's intent, and should not change
functionality.

Change-Id: I1a1b5eafb97b8593e5261e0edc38448093fd2858
This commit is contained in:
Nolan Brubaker 2016-05-31 11:53:09 -04:00
parent 61339f1e9d
commit bd33008938

View File

@ -659,11 +659,9 @@ def _add_additional_networks(key, inventory, ip_q, q_name, netmask, interface,
cidr_present = route.get('cidr', False)
gateway_present = route.get('gateway', False)
if cidr_present and gateway_present:
networks[old_address]['static_routes'].append(route)
elif not cidr_present or not gateway_present:
if not (cidr_present and gateway_present):
raise MissingStaticRouteInfo(q_name)
networks[old_address]['static_routes'].append(route)
def _net_address_search(provider_networks, main_network, key):