refactor(debug): Exit code 12 is now 6 which had become unused

This commit is contained in:
hygienic-books 2022-07-05 18:01:18 +02:00
parent 7f7cd29cb7
commit 4986b970d8

View File

@ -32,13 +32,12 @@ import difflib
# 3 : No physical network device found at "/sys/class/net" # 3 : No physical network device found at "/sys/class/net"
# 4 : Linux find command exited non-zero trying to find a physical network device at "/sys/class/net" # 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 : Kernel sysfs export for network devices at "/sys/class/net" doesn't exist
# 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
# 8 : Exception while adding a chain XML element to firewalld direct rules # 8 : Exception while adding a chain XML element to firewalld direct rules
# 9 : Unable to open firewalld direct rules file for updating # 9 : Unable to open firewalld direct rules file for updating
# 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
class CONST(object): class CONST(object):
@ -356,8 +355,8 @@ def get_phy_nics() -> list:
else: else:
log.error(f"Path {linux_sysfs_nics_abs!r} does not exist. This might not be a Linux-y operating system. " log.error(f"Path {linux_sysfs_nics_abs!r} does not exist. This might not be a Linux-y operating system. "
f"Without that location we'll not be able to separate physical network interfaces from virtual ones. " f"Without that location we'll not be able to separate physical network interfaces from virtual ones. "
f"Exiting 12 ...") f"Exiting 6 ...")
sys.exit(12) sys.exit(6)
log.debug(f"List of identified physical network interfaces: {phy_nics}") log.debug(f"List of identified physical network interfaces: {phy_nics}")
return phy_nics return phy_nics