mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-13 04:06:33 +00:00
Fix AppArmor name-related exceptions (#4078)
- 'Too many' is misleading if there are no profiles. - profiles just returns set() -- using profile_file should be more correct.
This commit is contained in:
parent
99e0eab958
commit
47fd849319
@ -25,9 +25,15 @@ def get_profile_name(profile_file):
|
||||
f"Can't read AppArmor profile: {err}", _LOGGER.error
|
||||
) from err
|
||||
|
||||
if len(profiles) == 0:
|
||||
raise AppArmorInvalidError(
|
||||
f"Missing AppArmor profile inside file: {profile_file.name}", _LOGGER.error
|
||||
)
|
||||
|
||||
if len(profiles) != 1:
|
||||
raise AppArmorInvalidError(
|
||||
f"To many profiles inside file: {profiles}", _LOGGER.error
|
||||
f"Too many AppArmor profiles inside file: {profile_file.name}",
|
||||
_LOGGER.error,
|
||||
)
|
||||
|
||||
return profiles.pop()
|
||||
|
Loading…
x
Reference in New Issue
Block a user