Skip to content

Commit

Permalink
style fixmes
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed Nov 25, 2014
1 parent 3065ec3 commit 2dbc4c5
Show file tree
Hide file tree
Showing 16 changed files with 22 additions and 27 deletions.
5 changes: 0 additions & 5 deletions .rubocop.yml
Expand Up @@ -115,11 +115,6 @@ Style/AndOr:
Style/CaseIndentation:
IndentWhenRelativeTo: end

# Offense count: 22
# Configuration parameters: Keywords.
Style/CommentAnnotation:
Enabled: false

# Offense count: 2
# Cop supports --auto-correct.
Style/CommentIndentation:
Expand Down
2 changes: 1 addition & 1 deletion src/clients/bootloader_finish.rb
Expand Up @@ -173,7 +173,7 @@ def main
Builtins.y2milestone("Regerate initrd with result #{res}")
end

# FIXME workaround grub2 need manual rerun of branding due to overwrite by
# FIXME: workaround grub2 need manual rerun of branding due to overwrite by
# pbl. see bnc#879686 and bnc#901003
if Bootloader.getLoaderType =~ /grub2/
prefix = Installation.destdir
Expand Down
2 changes: 1 addition & 1 deletion src/include/bootloader/routines/autoinstall.rb
Expand Up @@ -128,7 +128,7 @@ def AI2Export(ai)

unsupported_bootloaders = ["grub", "zipl", "plilo", "lilo", "elilo"]
if ai["loader_type"] && unsupported_bootloaders.include?(exp["loader_type"].downcase)
# FIXME this should be better handled by exception and show it properly, but it require too big change now
# FIXME: this should be better handled by exception and show it properly, but it require too big change now
Popup.Error(_("Unsupported bootloader '%s'. Adapt your AutoYaST profile accordingly.") %
exp["loader_type"])
return nil
Expand Down
2 changes: 1 addition & 1 deletion src/include/bootloader/routines/global_widgets.rb
Expand Up @@ -129,7 +129,7 @@ def LoaderTypeComboInit(widget)
# @return [Symbol] to return to wizard sequencer, or nil
def LoaderTypeComboHandle(key, event)
event = deep_copy(event)
return if event["ID"] != key # FIXME can it happen at all?
return if event["ID"] != key # FIXME: can it happen at all?
old_bl = Bootloader.getLoaderType
new_bl = UI.QueryWidget(Id(key), :Value).to_s

Expand Down
6 changes: 3 additions & 3 deletions src/include/bootloader/routines/misc.rb
Expand Up @@ -156,7 +156,7 @@ def GetBootloaderDevices
# @return [String] value, "false" if not present,
# "true" if present key without value
def getKernelParamFromLine(line, key)
# FIXME this doesn't work with quotes and spaces
# FIXME: this doesn't work with quotes and spaces
res = "false"
# we can get nil if params is not yet proposed, so return not there (bnc#902397)
return res unless line
Expand All @@ -181,7 +181,7 @@ def kernel_param_key(value)
# @return [String] new kernel command line
def setKernelParamToLine(line, key, value)
line ||= ""
# FIXME this doesn't work with quotes and spaces
# FIXME: this doesn't work with quotes and spaces
params = line.split(" ").reject(&:empty?)
# count occurences of every parameter, initial value is 0
occurences = Hash.new { |_k| 0 }
Expand Down Expand Up @@ -236,7 +236,7 @@ def restoreMBR(device)
# Get map of swap partitions
# @return a map where key is partition name and value its size
def getSwapPartitions
# FIXME move to boot storage
# FIXME: move to boot storage
tm = Storage.GetTargetMap
ret = {}
tm.each do |_k, v|
Expand Down
2 changes: 1 addition & 1 deletion src/lib/bootloader/device_map.rb
Expand Up @@ -174,7 +174,7 @@ def filtered_target_map

def propose_s390_device_map
# s390 have some special requirements for device map. Keep it short and simple (bnc#884798)
# TODO device map is not needed at all for s390, so if we get rid of perl-Bootloader translations
# TODO: device map is not needed at all for s390, so if we get rid of perl-Bootloader translations
# we can keep it empty
boot_part = Yast::Storage.GetEntryForMountpoint("/boot/zipl")
boot_part = Yast::Storage.GetEntryForMountpoint("/boot") if boot_part.empty?
Expand Down
2 changes: 1 addition & 1 deletion src/lib/bootloader/mbr_update.rb
Expand Up @@ -10,7 +10,7 @@
module Bootloader
# this class place generic MBR wherever it is needed
# and also mark needed partitions with boot flag and legacy_boot
# FIXME make it single responsibility class
# FIXME: make it single responsibility class
class MBRUpdate
include Yast::Logger

Expand Down
2 changes: 1 addition & 1 deletion src/lib/bootloader/stage1.rb
Expand Up @@ -175,7 +175,7 @@ def assign_bootloader_device(selected_location)
end
end

# FIXME find better location
# FIXME: find better location
def gpt_boot_disk?
targets = Yast::BootCommon.GetBootloaderDevices
boot_discs = targets.map {|d| Yast::Storage.GetDisk(target_map, d)}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/bootloader/udev_mapping.rb
Expand Up @@ -21,7 +21,7 @@ class << self
end

# Returns hash where keys are udev links for disks and partitions and value their kernel devices.
# TODO remove when remove pbl support
# TODO: remove when remove pbl support
# @example of output
# {
# "/dev/disk/by-id/abcd" => "/dev/sda",
Expand Down
2 changes: 1 addition & 1 deletion src/modules/BootCommon.rb
Expand Up @@ -528,7 +528,7 @@ def VerifyMDArray
return false
end

# FIXME just backward compatible interface, call directly BootStorage
# FIXME: just backward compatible interface, call directly BootStorage
def Md2Partitions(md_device)
BootStorage.Md2Partitions(md_device)
end
Expand Down
6 changes: 3 additions & 3 deletions src/modules/BootStorage.rb
Expand Up @@ -82,7 +82,7 @@ def main
#
# @return [Hash{String => String}] mapping real disk to multipath

# FIXME grub only
# FIXME: grub only

def mapRealDevicesToMultipath
ret = {}
Expand Down Expand Up @@ -303,7 +303,7 @@ def checkMDDevices(tm, device)

if p["raid_type"] == "raid1"
p_devices = p["devices"] || []
if p_devices.size == 2 # TODO why only 2? it do not make sense
if p_devices.size == 2 # TODO: why only 2? it do not make sense
ret = checkDifferentDisks(p_devices)
else
log.info "Device: #{device} doesn't contain 2 partitions: #{p_devices}"
Expand Down Expand Up @@ -397,7 +397,7 @@ def Md2Partitions(md_device)

# returns disk names where partition lives
def real_disks_for_partition(partition)
# FIXME handle somehow if disk are in logical raid
# FIXME: handle somehow if disk are in logical raid
partitions = Md2Partitions(partition).keys
partitions = [partition] if partitions.empty?
res = partitions.map do |part|
Expand Down
2 changes: 1 addition & 1 deletion src/modules/BootSupportCheck.rb
Expand Up @@ -108,7 +108,7 @@ def GptPartitionTable
ret = true
tm = Storage.GetTargetMap
devices = [BootStorage.BootPartitionDevice]
# TODO add more devices
# TODO: add more devices
Builtins.foreach(devices) do |dev|
p_dev = Storage.GetDiskPartition(dev)
num = p_dev["nr"].to_i
Expand Down
2 changes: 1 addition & 1 deletion test/data/storage_ppc.rb
@@ -1,4 +1,4 @@
# TODO create factory like method for Storage
# TODO: create factory like method for Storage
{
"/dev/sda" => {
"unique" => "3OOL.41o+EUK3QE2",
Expand Down
8 changes: 4 additions & 4 deletions test/device_map_test.rb
Expand Up @@ -39,7 +39,7 @@
expect(subject.to_hash).to be_empty
end

# TODO I do not have sufficient target map yet
# TODO: I do not have sufficient target map yet
it "do not add to device map members of raids and multipath"

it "do not add non-disk devices" do
Expand All @@ -49,13 +49,13 @@
expect(subject.to_hash).to_not include("/dev/tmpfs")
end

# TODO I do not have sufficient target map yet with enough disks and mixture of bios ids
# TODO: I do not have sufficient target map yet with enough disks and mixture of bios ids
it "propose order according to bios id"

# TODO I do not have sufficient target map yet
# TODO: I do not have sufficient target map yet
it "do not propose USB as first device"

# TODO I do not have sufficient target map yet with enough disks and mixture of bios ids
# TODO: I do not have sufficient target map yet with enough disks and mixture of bios ids
it "propose as first device disk containing /boot"
end

Expand Down
2 changes: 1 addition & 1 deletion test/disk_change_detector_test.rb
Expand Up @@ -7,7 +7,7 @@
describe Bootloader::DiskChangeDetector do
before do
Yast.import "Storage"
mount_points = { #TODO full mock
mount_points = { #TODO: full mock
"/" => ["/dev/sda1"],
"/boot" => ["/dev/sda2"]
}
Expand Down
2 changes: 1 addition & 1 deletion test/mbr_update_test.rb
Expand Up @@ -67,7 +67,7 @@
subject.run
end

# FIXME get reason for it
# FIXME: get reason for it
it "creates backup for all devices in BootCommon.GetBootloaderDevices if at least one device lies on mbrDisk" do
expect(::Bootloader::BootRecordBackup).to(
receive(:new).with("/dev/sda").and_return(double(:write => true))
Expand Down

0 comments on commit 2dbc4c5

Please sign in to comment.