From 625739bd31f33b84338a777cbc3ca14207e2cd74 Mon Sep 17 00:00:00 2001 From: John Bowdre Date: Wed, 22 Dec 2021 06:35:00 -0600 Subject: [PATCH] fix inverted logic in gateway check (#3) --- pom.xml | 2 +- src/main/python/get_ip_ranges/source.py | 2 +- src/main/resources/CHANGELOG.md | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 40306cd..a642a19 100644 --- a/pom.xml +++ b/pom.xml @@ -23,7 +23,7 @@ conditions of the subcomponent's license, as noted in the LICENSE file. phpIPAM phpIPAM integration for vRA - 1.0.7 + 1.0.8 false true diff --git a/src/main/python/get_ip_ranges/source.py b/src/main/python/get_ip_ranges/source.py index e29824d..abac257 100644 --- a/src/main/python/get_ip_ranges/source.py +++ b/src/main/python/get_ip_ranges/source.py @@ -93,7 +93,7 @@ def do_get_ip_ranges(self, auth_credentials, cert): ipRange['dnsServerAddresses'] = [] # try to get the address marked as the gateway in IPAM gw_req = requests.get(f"{subnet_uri}/{subnet['id']}/addresses/?filter_by=is_gateway&filter_value=1", headers=token, verify=cert) - if gw_req.status_code == 200 and not 'data' in gw_req.json(): + if gw_req.status_code == 200 and 'data' in gw_req.json(): gateway = gw_req.json()['data'][0]['ip'] ipRange['gatewayAddress'] = gateway logging.debug(ipRange) diff --git a/src/main/resources/CHANGELOG.md b/src/main/resources/CHANGELOG.md index 92ed0d7..24a894e 100644 --- a/src/main/resources/CHANGELOG.md +++ b/src/main/resources/CHANGELOG.md @@ -1,3 +1,6 @@ +# v1.0.8 +Fix gateway check logic + # v1.0.7 Enable optional custom subnet filter