mirror of
https://github.com/jbowdre/phpIPAM-for-vRA8.git
synced 2024-11-23 07:22:19 +00:00
fix for detecting ranges with no gateway set, #3
This commit is contained in:
parent
9d85a69eed
commit
8861002c96
1 changed files with 1 additions and 1 deletions
|
@ -84,7 +84,7 @@ def do_get_ip_ranges(self, auth_credentials, cert):
|
||||||
ipRange['dnsServerAddresses'] = []
|
ipRange['dnsServerAddresses'] = []
|
||||||
# try to get the address marked as the gateway in IPAM
|
# 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)
|
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:
|
if gw_req.status_code == 200 and not 'data' in gw_req.json():
|
||||||
gateway = gw_req.json()['data'][0]['ip']
|
gateway = gw_req.json()['data'][0]['ip']
|
||||||
ipRange['gatewayAddress'] = gateway
|
ipRange['gatewayAddress'] = gateway
|
||||||
logging.debug(ipRange)
|
logging.debug(ipRange)
|
||||||
|
|
Loading…
Reference in a new issue