Skip to content

Commit

Permalink
Code review 2: killing more Mode.test
Browse files Browse the repository at this point in the history
  • Loading branch information
ancorgs committed Mar 3, 2017
1 parent 7f80a73 commit fcaa7bc
Showing 1 changed file with 14 additions and 25 deletions.
39 changes: 14 additions & 25 deletions src/modules/RootPart.rb
Expand Up @@ -293,21 +293,19 @@ def AddMountedPartition(partinfo)

# Check the filesystem of a partition.
def FSCKPartition(partition)
if !Mode.test
detected_fs = probed.partitions.with(name: partition).filesystems.first.to_s.to_sym
if detected_fs == :ext2
# label, %1 is partition
out = Builtins.sformat(_("Checking partition %1"), partition)
UI.OpenDialog(Opt(:decorated), Label(out))

Builtins.y2milestone("command: /sbin/e2fsck -y %1", partition)
SCR.Execute(
path(".target.bash"),
Ops.add("/sbin/e2fsck -y ", partition)
)
detected_fs = probed.partitions.with(name: partition).filesystems.first.to_s.to_sym
if detected_fs == :ext2
# label, %1 is partition
out = Builtins.sformat(_("Checking partition %1"), partition)
UI.OpenDialog(Opt(:decorated), Label(out))

UI.CloseDialog
end
Builtins.y2milestone("command: /sbin/e2fsck -y %1", partition)
SCR.Execute(
path(".target.bash"),
Ops.add("/sbin/e2fsck -y ", partition)
)

UI.CloseDialog
end

nil
Expand Down Expand Up @@ -2056,17 +2054,8 @@ def FindRootPartitions

freshman = {}

if Mode.test
freshman = {
valid: true,
name: "SuSE Linux 4.2",
arch: "i286",
label: "Label"
}
else
log.debug("Checking partition: #{partition}")
freshman = CheckPartition(partition)
end
log.debug("Checking partition: #{partition}")
freshman = CheckPartition(partition)

@rootPartitions[partition.name] = freshman
@numberOfValidRootPartitions += 1 if freshman[:valid]
Expand Down

0 comments on commit fcaa7bc

Please sign in to comment.