Skip to content

Commit

Permalink
Check for both nil and empty string and don't let settings override a…
Browse files Browse the repository at this point in the history
…gain
  • Loading branch information
shundhammer committed Aug 17, 2017
1 parent 3d90554 commit a0c78ae
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/modules/StorageProposal.rb
Expand Up @@ -328,9 +328,6 @@ def GetControlCfg
end
log.info("home_path: #{@home_path}") unless @home_path == DEFAULT_HOME_PATH

@proposal_home_fs = get_fs_type_from_control_xml("home_fs", @proposal_home_fs)
@proposal_root_fs = get_fs_type_from_control_xml("root_fs", @proposal_root_fs)

btmp = ProductFeatures.GetBooleanFeature("partitioning", "proposal_lvm")
Ops.set(@cfg_xml, "prop_lvm", btmp ? true : false)

Expand Down Expand Up @@ -359,6 +356,9 @@ def GetControlCfg

SetProposalDefault(false)
Builtins.y2milestone("GetControlCfg cfg_xml: %1", @cfg_xml)

@proposal_home_fs = get_fs_type_from_control_xml("home_fs", @proposal_home_fs)
@proposal_root_fs = get_fs_type_from_control_xml("root_fs", @proposal_root_fs)
end
ret = deep_copy(@cfg_xml)
Builtins.y2milestone(
Expand Down Expand Up @@ -6693,7 +6693,8 @@ def strategy=(value)
# @return [Symbol] filesystem type (:btrfs, :xfs, :ext4, ...)
#
def get_fs_type_from_control_xml(name, fallback)
fs = ProductFeatures.GetStringFeature("partitioning", name) || fallback
fs = ProductFeatures.GetStringFeature("partitioning", name)
fs = fallback if fs.nil? || fs.empty?
fs = fs.downcase.to_sym unless fs.is_a?(Symbol)
log.info("#{name}: #{fs}") unless fs == fallback
fs
Expand Down

0 comments on commit a0c78ae

Please sign in to comment.