Stages/tuned: skip non-existing profile directories
Previously, the stage would try to call `os.scandir()` on non-existing profile directories, which results in an exception. While the directories that it scans are currently created by the TuneD RPM package when installed, it it much nicer to gracefully handle their potential non-existence, than to fail with an exception. Signed-off-by: Tomáš Hozza <thozza@redhat.com>
This commit is contained in:
parent
350ae9ed40
commit
67d9663c83
1 changed files with 3 additions and 0 deletions
|
|
@ -34,6 +34,9 @@ class TunedProfilesDB:
|
|||
|
||||
for path in profile_directories:
|
||||
profiles_dir = f"{tree}{path}"
|
||||
if not os.path.isdir(profiles_dir):
|
||||
continue
|
||||
|
||||
# Since version 2.23.0, TuneD by default uses `profiles/` subdirectory.
|
||||
# If the subdirectory exists, we look for profiles there.
|
||||
if os.path.isdir(f"{profiles_dir}/profiles"):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue