refactor(debug): Exit code 14 is now 3 which had become unused

This commit is contained in:
hygienic-books 2022-07-05 17:59:31 +02:00
parent 5064a66c3e
commit 569e97d6d6

View File

@ -29,7 +29,7 @@ import difflib
# Exit codes # Exit codes
# 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 : Performing a firewalld rules check failed # 3 : No physical network device found at "/sys/class/net"
# 4 : Performing a firewalld rules encountered a FileNotFoundError # 4 : Performing a firewalld rules encountered a FileNotFoundError
# 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
@ -40,7 +40,6 @@ import difflib
# 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" # 13: Linux find command exited non-zero trying to find a physical network device at "/sys/class/net"
# 14: No physical network device found at "/sys/class/net"
class CONST(object): class CONST(object):
@ -350,8 +349,8 @@ def get_phy_nics() -> list:
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"
f"Command was:\n" f"Command was:\n"
f"{phy_nics_find.args}\n" f"{phy_nics_find.args}\n"
f"Exiting 14 ...") f"Exiting 3 ...")
sys.exit(14) sys.exit(3)
for line in phy_nics_find.stdout.rstrip().split("\n"): for line in phy_nics_find.stdout.rstrip().split("\n"):
log.debug(f"Found physical network device {(phy_nic := os.path.basename(line))!r}") log.debug(f"Found physical network device {(phy_nic := os.path.basename(line))!r}")
phy_nics.append(phy_nic) phy_nics.append(phy_nic)