Commit 1b8e4561 authored by Vitaly Lipatov's avatar Vitaly Lipatov

gateway: fail unban CLI on invalid invocation

parent cad9cdbd
...@@ -10,7 +10,7 @@ import ipaddress ...@@ -10,7 +10,7 @@ import ipaddress
def get_settings (path_to_config): def get_settings (path_to_config):
if not os.path.exists(path_to_config): if not os.path.exists(path_to_config):
print("Missed config file") print("Missed config file")
sys.exit() sys.exit(1)
config = configparser.ConfigParser() config = configparser.ConfigParser()
config.read(path_to_config) config.read(path_to_config)
...@@ -40,7 +40,7 @@ else: ...@@ -40,7 +40,7 @@ else:
if not ip: if not ip:
print("Run with IP arg") print("Run with IP arg")
sys.exit() sys.exit(1)
try: try:
ip = str(ipaddress.ip_network(ip, strict=False)) ip = str(ipaddress.ip_network(ip, strict=False))
except ValueError: except ValueError:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment