refactor(debug): Exit code 13 is now 4 which had become unused

This commit is contained in:
hygienic-books 2022-07-05 18:00:25 +02:00
parent 569e97d6d6
commit 7f7cd29cb7

View File

@ -30,7 +30,7 @@ import difflib
# 1 : Config file invalid, it has no sections # 1 : Config file invalid, it has no sections
# 2 : Config file invalid, sections must define at least CONST.CFG_MANDATORY # 2 : Config file invalid, sections must define at least CONST.CFG_MANDATORY
# 3 : No physical network device found at "/sys/class/net" # 3 : No physical network device found at "/sys/class/net"
# 4 : Performing a firewalld rules encountered a FileNotFoundError # 4 : Linux find command exited non-zero trying to find a physical network device at "/sys/class/net"
# 5 : Unable to open firewalld direct rules file for reading # 5 : Unable to open firewalld direct rules file for reading
# 6 : Source and destination are identical when attempting to back up firewalld direct rules file # 6 : Source and destination are identical when attempting to back up firewalld direct rules file
# 7 : An option that must have a non-null value is either unset or null # 7 : An option that must have a non-null value is either unset or null
@ -39,7 +39,6 @@ import difflib
# 10: Unable to restart systemd firewalld.service unit # 10: Unable to restart systemd firewalld.service unit
# 11: Unable to add a <rule/> tag to firewalld # 11: Unable to add a <rule/> tag to firewalld
# 12: Kernel sysfs export for network devices at "/sys/class/net" doesn't exist # 12: Kernel sysfs export for network devices at "/sys/class/net" doesn't exist
# 13: Linux find command exited non-zero trying to find a physical network device at "/sys/class/net"
class CONST(object): class CONST(object):
@ -342,8 +341,8 @@ def get_phy_nics() -> list:
f"{cpe.cmd}\n" f"{cpe.cmd}\n"
f"Verbatim command output was:\n" f"Verbatim command output was:\n"
f"{cpe.output.rstrip()}\n" f"{cpe.output.rstrip()}\n"
f"Exiting 13 ...") f"Exiting 4 ...")
sys.exit(13) sys.exit(4)
else: else:
if not phy_nics_find.stdout: if not phy_nics_find.stdout:
log.error(f"No physical network device found at {linux_sysfs_nics_abs!r}.\n" log.error(f"No physical network device found at {linux_sysfs_nics_abs!r}.\n"