Skip to content

Commit

Permalink
Make Rubocop happy
Browse files Browse the repository at this point in the history
  • Loading branch information
imobachgs committed Oct 16, 2018
1 parent 8da6fa2 commit 4cc3677
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions src/lib/y2storage/autoinst_profile/drive_section.rb
Original file line number Diff line number Diff line change
Expand Up @@ -249,12 +249,7 @@ def init_from_disk(disk)
@partitions.each { |i| i.create = false } if reuse_partitions?(disk)

# Same logic followed by the old exporter
@use =
if disk.partitions.any? { |i| windows?(i) }
@partitions.map(&:partition_nr)
else
"all"
end
@use = use_value_from_disk(disk, @partitions)

true
end
Expand Down Expand Up @@ -440,6 +435,19 @@ def used?(disk)
def disklabel_from_disk(disk)
disk.partition_table ? disk.partition_table.type.to_s : NO_PARTITION_TABLE
end

# Determines the value of the 'use' element for a disk/dasd device
#
# @param disk [Y2Storage::Disk, Y2Storage::Dasd] Disk
# @param partitions [Y2Storage::AutoinstProposal::PartitionSection] Set of partition sections
# @return [String] Value of the 'use' element for a disk.
def use_value_from_storage(disk, partitions)
if disk.partitions.any? { |i| windows?(i) }
partitions.map(&:partition_nr)
else
"all"
end
end
end
end
end

0 comments on commit 4cc3677

Please sign in to comment.