diff options
| author | Joel Challis <git@zvecr.com> | 2023-01-09 08:21:21 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-09 08:21:21 +0000 |
| commit | 1b045b1e60c2c10178828b20036a3590784bbbfc (patch) | |
| tree | 8923a15d3a8332559045e76642faa2cd29342e05 /lib/python/qmk/cli | |
| parent | cf55032485dd2b3572b78c08a2f30ae510a5fdf0 (diff) | |
Handle doctor permission issues while checking udev (#19548)
Diffstat (limited to 'lib/python/qmk/cli')
| -rw-r--r-- | lib/python/qmk/cli/doctor/linux.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/python/qmk/cli/doctor/linux.py b/lib/python/qmk/cli/doctor/linux.py index a803305c0d..95bafe8c64 100644 --- a/lib/python/qmk/cli/doctor/linux.py +++ b/lib/python/qmk/cli/doctor/linux.py | |||
| @@ -78,10 +78,13 @@ def check_udev_rules(): | |||
| 78 | 78 | ||
| 79 | # Collect all rules from the config files | 79 | # Collect all rules from the config files |
| 80 | for rule_file in udev_rules: | 80 | for rule_file in udev_rules: |
| 81 | for line in rule_file.read_text(encoding='utf-8').split('\n'): | 81 | try: |
| 82 | line = line.strip() | 82 | for line in rule_file.read_text(encoding='utf-8').split('\n'): |
| 83 | if not line.startswith("#") and len(line): | 83 | line = line.strip() |
| 84 | current_rules.add(line) | 84 | if not line.startswith("#") and len(line): |
| 85 | current_rules.add(line) | ||
| 86 | except PermissionError: | ||
| 87 | cli.log.debug("Failed to read: %s", rule_file) | ||
| 85 | 88 | ||
| 86 | # Check if the desired rules are among the currently present rules | 89 | # Check if the desired rules are among the currently present rules |
| 87 | for bootloader, rules in desired_rules.items(): | 90 | for bootloader, rules in desired_rules.items(): |
