Skip to content

Commit

Permalink
Log some info when falling back to :disabled mode
Browse files Browse the repository at this point in the history
  • Loading branch information
dgdavid committed Feb 3, 2021
1 parent 92e8a80 commit a1baca1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/lib/y2security/selinux_config.rb
Expand Up @@ -105,7 +105,13 @@ def modes
# @param id [SelinuxConfig::Mode, String, Symbol, nil] a SELinux mode or its identifier
# @return [Mode] the SelinuxConfig::Mode by given id or disabled is none found or nil was given
def mode=(id)
found_mode = Mode.find(id) || Mode.find(:disabled)
found_mode = Mode.find(id)

if found_mode.nil?
log.info("Requested SELinux mode `#{id}` not found. Falling back to :disabled.")
found_mode = Mode.find(:disabled)
end

@mode = found_mode
@mode
end
Expand Down

0 comments on commit a1baca1

Please sign in to comment.