enhance logging + remove some comments

This commit is contained in:
Emilien Devos 2023-10-15 11:20:52 +02:00
parent c9fd40ded3
commit 61c019c2b1

View File

@ -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")
@ -201,8 +199,8 @@ The available args are:
self.clean_previous_setup(memory_settings)
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}"
" That's unexpected! Did you correctly configured the IPv6 subnet to use?\n"
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(