mirror of
https://github.com/iv-org/smart-ipv6-rotator.git
synced 2024-11-23 05:59:45 +00:00
enhance logging + remove some comments
This commit is contained in:
parent
c9fd40ded3
commit
61c019c2b1
@ -49,8 +49,6 @@ The available args are:
|
||||
""",
|
||||
)
|
||||
parser.add_argument("command", help="Subcommand to run")
|
||||
# parse_args defaults to [1:] for args, but you need to
|
||||
# exclude the rest of the args too, or validation will fail
|
||||
args = parser.parse_args(sys.argv[1:2])
|
||||
if not hasattr(self, args.command):
|
||||
print("Unrecognized command")
|
||||
@ -202,7 +200,7 @@ The available args are:
|
||||
sys.exit(
|
||||
"[Error] Failed to add the new random IPv6 address. The setup did not work!\n"
|
||||
" That's unexpected! Did you correctly configured the IPv6 subnet to use?\n"
|
||||
f"Exception:\n{e}"
|
||||
f" Exception:\n{e}"
|
||||
)
|
||||
# needed so that the linux kernel takes into account the new ipv6 address
|
||||
sleep(2)
|
||||
@ -221,7 +219,7 @@ The available args are:
|
||||
self.clean_previous_setup(memory_settings)
|
||||
sys.exit(
|
||||
"[Error] Failed to configure the test IPv6 route. The setup did not work!\n"
|
||||
f"Exception:\n{e}"
|
||||
f" Exception:\n{e}"
|
||||
)
|
||||
# needed so that the linux kernel takes into account the new ipv6 route
|
||||
sleep(2)
|
||||
@ -239,7 +237,7 @@ The available args are:
|
||||
sys.exit(
|
||||
"[ERROR] The new random IPv6 is not used! The setup did not work!\n"
|
||||
" That is very unexpected, check if your IPv6 routes do not have too much priority."
|
||||
f"Address used: {response_new_ipv6_address}"
|
||||
f" Address used: {response_new_ipv6_address}"
|
||||
)
|
||||
except requests.exceptions.RequestException as e:
|
||||
self.clean_previous_setup(memory_settings)
|
||||
@ -247,7 +245,7 @@ The available args are:
|
||||
"[ERROR] Failed to send the request for checking the new IPv6 address! The setup did not work!\n"
|
||||
" Your provider probably does not allow setting any arbitrary IPv6 address.\n"
|
||||
" Or did you correctly configured the IPv6 subnet to use?\n"
|
||||
f"Exception:\n{e}"
|
||||
f" Exception:\n{e}"
|
||||
)
|
||||
|
||||
# configure routes for ipv6 ranges of Google
|
||||
@ -265,7 +263,7 @@ The available args are:
|
||||
self.clean_previous_setup(memory_settings)
|
||||
sys.exit(
|
||||
f"[Error] Failed to configure the test IPv6 route. The setup did not work!\n"
|
||||
f"Exception:\n{e}"
|
||||
f" Exception:\n{e}"
|
||||
)
|
||||
|
||||
print(
|
||||
|
Loading…
Reference in New Issue
Block a user