Commit 2ea04ea3 authored by Nigel Kukard's avatar Nigel Kukard
Browse files

Use sys.exit and not exit

parent 0782e5ea
......@@ -19,6 +19,7 @@ import ipaddress
import json
import locale
import re
import sys
from configparser import ConfigParser
from typing import Any, Optional
......@@ -318,7 +319,7 @@ class Ili:
# If the user selected cancel, we need to abort
if code == self._dialog.DIALOG_CANCEL:
exit(0)
sys.exit(0)
# If no disks were selected, we need to display an error, and do it again
if not disks:
......@@ -349,7 +350,7 @@ class Ili:
# If the user selected cancel, we need to abort
if code == self._dialog.DIALOG_CANCEL:
exit(0)
sys.exit(0)
# If no disk usage strategy was selected, we need to display an error, and do it again
if not chosen_strategy:
......@@ -380,7 +381,7 @@ class Ili:
# If the user selected cancel, we need to abort
if code == self._dialog.DIALOG_CANCEL:
exit(0)
sys.exit(0)
# If no disk layout strategy was selected, we need to display an error, and do it again
if not chosen_strategy:
......@@ -411,7 +412,7 @@ class Ili:
# If the user selected cancel, we need to abort
if code == self._dialog.DIALOG_CANCEL:
exit(0)
sys.exit(0)
# If no strategy was selected, we need to display an error, and do it again
if not chosen_strategy:
......@@ -442,7 +443,7 @@ class Ili:
# If the user selected cancel, we need to abort
if code == self._dialog.DIALOG_CANCEL:
exit(0)
sys.exit(0)
# If no kernel was selected, we need to display an error, and do it again
if not chosen_kernel:
......@@ -472,7 +473,7 @@ class Ili:
# If the user selected cancel, we need to abort
if code == self._dialog.DIALOG_CANCEL:
exit(0)
sys.exit(0)
# If no addressing type was selected, we need to display an error, and do it again
if not chosen_addressing:
......@@ -498,7 +499,7 @@ class Ili:
# If the user selected cancel, we need to abort
if code == self._dialog.DIALOG_CANCEL:
exit(0)
sys.exit(0)
# If no IPv4 address was selected, complain
if not ipv4address_raw:
......@@ -523,7 +524,7 @@ class Ili:
# If the user selected cancel, we need to abort
if code == self._dialog.DIALOG_CANCEL:
exit(0)
sys.exit(0)
# If no IPv4 gateway was entered break, else process it
if not ipv4gateway_raw:
......@@ -575,7 +576,7 @@ class Ili:
# If the user selected cancel, we need to abort
if code == self._dialog.DIALOG_CANCEL:
exit(0)
sys.exit(0)
# If no IPv6 gateway was entered break, else process it
if not ipv6gateway_raw:
......@@ -600,7 +601,7 @@ class Ili:
# If the user selected cancel, we need to abort
if code == self._dialog.DIALOG_CANCEL:
exit(0)
sys.exit(0)
# If no DNS1 address was entered break, else process it
if not dns1address_raw:
......@@ -626,7 +627,7 @@ class Ili:
# If the user selected cancel, we need to abort
if code == self._dialog.DIALOG_CANCEL:
exit(0)
sys.exit(0)
# If no DNS2 address was entered break, else process it
if not dns2address_raw:
......@@ -659,7 +660,7 @@ class Ili:
# If the user selected cancel, we need to abort
if code == self._dialog.DIALOG_CANCEL:
exit(0)
sys.exit(0)
# If no option was chosen, display a warning
if not install_microcode:
......@@ -687,7 +688,7 @@ class Ili:
# If the user selected cancel, we need to abort
if code == self._dialog.DIALOG_CANCEL:
exit(0)
sys.exit(0)
# Set the hostname
self.state.hostname = hostname
......@@ -706,7 +707,7 @@ class Ili:
# If the user selected cancel, we need to abort
if code == self._dialog.DIALOG_CANCEL:
exit(0)
sys.exit(0)
# Set the root password if we got one
if root_password:
......@@ -726,7 +727,7 @@ class Ili:
# If the user selected cancel, we need to abort
if code == self._dialog.DIALOG_CANCEL:
exit(0)
sys.exit(0)
# Set the user username
if user_username:
......@@ -746,7 +747,7 @@ class Ili:
# If the user selected cancel, we need to abort
if code == self._dialog.DIALOG_CANCEL:
exit(0)
sys.exit(0)
# Set the user password if we got one
if user_password:
......@@ -773,7 +774,7 @@ class Ili:
"""Display error message to user and exit."""
self._error(*args)
exit(1)
sys.exit(1)
def _status_callback(self, line: str):
"""Status callback to give user feedback on the status of installation."""
......
Supports Markdown
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