Skip to content

Commit

Permalink
DRY writing
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed Oct 31, 2014
1 parent a06dbbe commit 8894bc8
Showing 1 changed file with 13 additions and 16 deletions.
29 changes: 13 additions & 16 deletions src/modules/Bootloader.rb
Expand Up @@ -294,14 +294,7 @@ def Write
ReadOrProposeIfNeeded()
end

if BootCommon.write_settings["save_all"]
BootCommon.save_all = true
end
if BootCommon.save_all
BootCommon.changed = true
BootCommon.location_changed = true
Initrd.changed = true
end
mark_as_changed

log.info "Writing bootloader configuration"

Expand Down Expand Up @@ -427,14 +420,7 @@ def WriteInstallation
log.info "Writing bootloader configuration during installation"
ret = true

if Ops.get_boolean(BootCommon.write_settings, "save_all", false)
BootCommon.save_all = true
end
if BootCommon.save_all
BootCommon.changed = true
BootCommon.location_changed = true
Initrd.changed = true
end
mark_as_changed

params_to_save = {}

Expand Down Expand Up @@ -886,6 +872,17 @@ def write_additional_files
end
end

def mark_as_changed
if BootCommon.write_settings["save_all"]
BootCommon.save_all = true
end
if BootCommon.save_all
BootCommon.changed = true
BootCommon.location_changed = true
Initrd.changed = true
end
end

publish :function => :Export, :type => "map ()"
publish :function => :Import, :type => "boolean (map)"
publish :function => :Propose, :type => "void ()"
Expand Down

0 comments on commit 8894bc8

Please sign in to comment.