chg: [IPAddress] Add Debug + Check if option is empty

pull/559/head
Terrtia 2021-02-23 15:16:29 +01:00
parent 9ae21171cc
commit 1c991aa792
No known key found for this signature in database
GPG Key ID: 1E1B1F50D84613D0
1 changed files with 6 additions and 1 deletions

View File

@ -62,9 +62,14 @@ if __name__ == '__main__':
p = Process(config_section)
ip_networks = []
networks = p.config.get("IP", "networks")
if not networks:
print('No IP ranges provided')
sys.exit(0)
try:
for network in p.config.get("IP", "networks").split(","):
for network in networks.split(","):
ip_networks.append(IPv4Network(network))
print(f'IP Range: {network}')
except:
print('Please provide a list of valid IP addresses')
sys.exit(0)