Skip to content

Commit

Permalink
Code improvements from review
Browse files Browse the repository at this point in the history
  • Loading branch information
ancorgs committed Aug 19, 2015
1 parent 9504f03 commit a9ce29c
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/modules/Security.rb
Expand Up @@ -415,7 +415,7 @@ def read_from_locations
val = ""
filename = nil
if file.include?("sysconfig")
filename = "/etc" + file.gsub(".", "/")
filename = "/etc" + file.tr(".", "/")
log.info "filename=#{filename}"
end
if filename.nil? || SCR.Read(path(".target.size"), filename) > 0
Expand Down Expand Up @@ -706,14 +706,13 @@ def apply_new_settings
def activate_changes
# NOTE: the call to #sort is only needed to satisfy the old testsuite
@activation_mapping.sort.each do |setting, action|
if @Settings[setting] != @Settings_bak[setting]
log.info(
"Option #{setting} has been modified, "\
"activating the change: #{action}"
)
res = SCR.Execute(path(".target.bash"), action)
log.error "Activation failed" if res != 0
end
next if @Settings[setting] == @Settings_bak[setting]
log.info(
"Option #{setting} has been modified, "\
"activating the change: #{action}"
)
res = SCR.Execute(path(".target.bash"), action)
log.error "Activation failed" if res != 0
end
end

Expand Down

0 comments on commit a9ce29c

Please sign in to comment.