Handle doctor permission issues while checking udev (#19548)
parent
cf55032485
commit
1b045b1e60
|
@ -78,10 +78,13 @@ def check_udev_rules():
|
||||||
|
|
||||||
# Collect all rules from the config files
|
# Collect all rules from the config files
|
||||||
for rule_file in udev_rules:
|
for rule_file in udev_rules:
|
||||||
for line in rule_file.read_text(encoding='utf-8').split('\n'):
|
try:
|
||||||
line = line.strip()
|
for line in rule_file.read_text(encoding='utf-8').split('\n'):
|
||||||
if not line.startswith("#") and len(line):
|
line = line.strip()
|
||||||
current_rules.add(line)
|
if not line.startswith("#") and len(line):
|
||||||
|
current_rules.add(line)
|
||||||
|
except PermissionError:
|
||||||
|
cli.log.debug("Failed to read: %s", rule_file)
|
||||||
|
|
||||||
# Check if the desired rules are among the currently present rules
|
# Check if the desired rules are among the currently present rules
|
||||||
for bootloader, rules in desired_rules.items():
|
for bootloader, rules in desired_rules.items():
|
||||||
|
|
Loading…
Reference in New Issue