fix inverted logic in gateway check (#3)

This commit is contained in:
John Bowdre 2021-12-22 06:35:00 -06:00
parent 6a042450f9
commit 625739bd31
3 changed files with 5 additions and 2 deletions

View file

@ -23,7 +23,7 @@ conditions of the subcomponent's license, as noted in the LICENSE file.
<properties>
<provider.name>phpIPAM</provider.name>
<provider.description>phpIPAM integration for vRA</provider.description>
<provider.version>1.0.7</provider.version>
<provider.version>1.0.8</provider.version>
<provider.supportsAddressSpaces>false</provider.supportsAddressSpaces>
<provider.supportsUpdateRecord>true</provider.supportsUpdateRecord>

View file

@ -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)

View file

@ -1,3 +1,6 @@
# v1.0.8
Fix gateway check logic
# v1.0.7
Enable optional custom subnet filter