From bd33008938098d566992ff61ec150d0ac9956afb Mon Sep 17 00:00:00 2001 From: Nolan Brubaker Date: Tue, 31 May 2016 11:53:09 -0400 Subject: [PATCH] Clarify static route requirements check Some static route verification was added in commit 894e0c4dc9bc56279e104a0bd0de68108aebb058, 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 --- playbooks/inventory/dynamic_inventory.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/playbooks/inventory/dynamic_inventory.py b/playbooks/inventory/dynamic_inventory.py index 96aa32472c..7a601427eb 100755 --- a/playbooks/inventory/dynamic_inventory.py +++ b/playbooks/inventory/dynamic_inventory.py @@ -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):