mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-23 06:37:15 +00:00
chg: [IPAddress] Add Debug + Check if option is empty
This commit is contained in:
parent
9ae21171cc
commit
1c991aa792
1 changed files with 6 additions and 1 deletions
|
@ -62,9 +62,14 @@ if __name__ == '__main__':
|
||||||
p = Process(config_section)
|
p = Process(config_section)
|
||||||
|
|
||||||
ip_networks = []
|
ip_networks = []
|
||||||
|
networks = p.config.get("IP", "networks")
|
||||||
|
if not networks:
|
||||||
|
print('No IP ranges provided')
|
||||||
|
sys.exit(0)
|
||||||
try:
|
try:
|
||||||
for network in p.config.get("IP", "networks").split(","):
|
for network in networks.split(","):
|
||||||
ip_networks.append(IPv4Network(network))
|
ip_networks.append(IPv4Network(network))
|
||||||
|
print(f'IP Range: {network}')
|
||||||
except:
|
except:
|
||||||
print('Please provide a list of valid IP addresses')
|
print('Please provide a list of valid IP addresses')
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
Loading…
Reference in a new issue