Skip to content

Commit

Permalink
make longer numbers more readable
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed Nov 26, 2014
1 parent 778e8fa commit c060aa2
Show file tree
Hide file tree
Showing 8 changed files with 84 additions and 84 deletions.
2 changes: 1 addition & 1 deletion .rubocop.yml
Expand Up @@ -153,7 +153,7 @@ Style/NegatedIf:
# Offense count: 66
# Cop supports --auto-correct.
Style/NumericLiterals:
MinDigits: 10
MinDigits: 4

# Offense count: 1
# Configuration parameters: EnforcedStyle, SupportedStyles.
Expand Down
4 changes: 2 additions & 2 deletions src/modules/BootSupportCheck.rb
Expand Up @@ -298,14 +298,14 @@ def EndOfBootOrRootPartition

end_cyl = Region.End(Ops.get_list(part, "region", []))

cyl_size = 82252800
cyl_size = 82_252_800
target_map = Storage.GetTargetMap
Builtins.foreach(target_map) do |_dev, disk|
partition = (disk["partitions"] || []).find do |p|
p["device"] == device
end

cyl_size = disk["cyl_size"] || 82252800 if partition
cyl_size = disk["cyl_size"] || 82_252_800 if partition
end

ret = Ops.multiply(end_cyl, cyl_size)
Expand Down
14 changes: 7 additions & 7 deletions test/data/storage_encrypted.rb
Expand Up @@ -2,8 +2,8 @@
"/dev/sda" => {
"bios_id" => "0x80",
"bus" => "IDE",
"cyl_count" => 1827,
"cyl_size" => 8225280,
"cyl_count" => 1_827,
"cyl_size" => 8_225_280,
"device" => "/dev/sda",
"driver" => "ahci",
"driver_module" => "ahci",
Expand All @@ -29,7 +29,7 @@
"name" => "sda1",
"nr" => 1,
"region" => [0, 261],
"size_k" => 2096482,
"size_k" => 2_096_482,
"type" => :primary,
"udev_id" => [
"ata-VBOX_HARDDISK_VB7c7aa34e-2f09570d-part1",
Expand Down Expand Up @@ -74,7 +74,7 @@
"name" => "sda2",
"nr" => 2,
"region" => [261, 25],
"size_k" => 200812,
"size_k" => 200_812,
"tunefs_opt" => "-c 0 -i 0",
"type" => :primary,
"udev_id" => [
Expand Down Expand Up @@ -120,8 +120,8 @@
"mountby" => :uuid,
"name" => "sda3",
"nr" => 3,
"region" => [286, 1540],
"size_k" => 12370050,
"region" => [286, 1_540],
"size_k" => 12_370_050,
"tunefs_opt" => "-c 0 -i 0",
"type" => :primary,
"udev_id" => [
Expand All @@ -139,7 +139,7 @@
],
"proposal_name" => "1. IDE Disk, 14.00 GiB, /dev/sda, VBOX-HARDDISK",
"sector_size" => 512,
"size_k" => 14680064,
"size_k" => 14_680_064,
"transport" => :sata,
"type" => :CT_DISK,
"udev_id" => [
Expand Down
22 changes: 11 additions & 11 deletions test/data/storage_lvm.rb
Expand Up @@ -9,8 +9,8 @@
},
"/dev/system" => {
"create" => true,
"cyl_count" => 1795,
"cyl_size" => 4194304,
"cyl_count" => 1_795,
"cyl_size" => 4_194_304,
"device" => "/dev/system",
"devices" => [],
"devices_add" => ["/dev/vda3"],
Expand All @@ -27,7 +27,7 @@
"mount" => "/",
"mountby" => :uuid,
"name" => "root",
"size_k" => 7352320,
"size_k" => 7_352_320,
"stripes" => 1,
"subvol" => [
{ "create" => true, "name" => "@/boot/grub2/i386-pc" },
Expand Down Expand Up @@ -56,17 +56,17 @@
}
],
"pe_free" => 0,
"pesize" => 4194304,
"size_k" => 7352320,
"pesize" => 4_194_304,
"size_k" => 7_352_320,
"type" => :CT_LVM,
"used_by_device" => "",
"used_by_type" => :UB_NONE
},
"/dev/vda" => {
"bios_id" => "0x80",
"bus" => "None",
"cyl_count" => 1044,
"cyl_size" => 8225280,
"cyl_count" => 1_044,
"cyl_size" => 8_225_280,
"device" => "/dev/vda",
"driver" => "virtio-pci",
"driver_module" => "virtio_pci",
Expand All @@ -83,7 +83,7 @@
"name" => "vda1",
"nr" => 1,
"region" => [0, 1],
"size_k" => 1024,
"size_k" => 1_024,
"type" => :primary,
"used_by_device" => "",
"used_by_type" => :UB_NONE,
Expand All @@ -101,7 +101,7 @@
"name" => "vda2",
"nr" => 2,
"region" => [1, 127],
"size_k" => 1026048,
"size_k" => 1_026_048,
"type" => :primary,
"used_by_device" => "",
"used_by_type" => :UB_NONE,
Expand All @@ -117,7 +117,7 @@
"name" => "vda3",
"nr" => 3,
"region" => [127, 917],
"size_k" => 7359488,
"size_k" => 7_359_488,
"type" => :primary,
"used_by" => [{ "device" => "/dev/system", "type" => :UB_LVM }],
"used_by_device" => "/dev/system",
Expand All @@ -126,7 +126,7 @@
],
"proposal_name" => "1. Disk, 8.00 GiB, /dev/vda, ",
"sector_size" => 512,
"size_k" => 8388608,
"size_k" => 8_388_608,
"transport" => :unknown,
"type" => :CT_DISK,
"unique" => "KSbE.Fxp0d3BezAE",
Expand Down
22 changes: 11 additions & 11 deletions test/data/storage_lvm_without_devices_add.rb
Expand Up @@ -9,8 +9,8 @@
},
"/dev/system" => {
"create" => false,
"cyl_count" => 1947,
"cyl_size" => 4194304,
"cyl_count" => 1_947,
"cyl_size" => 4_194_304,
"device" => "/dev/system",
"devices" => ["/dev/vda2"],
"lvm2" => true,
Expand All @@ -25,7 +25,7 @@
"mount" => "/",
"mountby" => :uuid,
"name" => "root",
"size_k" => 7815168,
"size_k" => 7_815_168,
"stripes" => 1,
"subvol" => [
{ "create" => true, "name" => "@/boot/grub2/i386-pc" },
Expand Down Expand Up @@ -59,7 +59,7 @@
"mount" => "swap",
"mountby" => :device,
"name" => "swap",
"size_k" => 155648,
"size_k" => 155_648,
"stripes" => 1,
"type" => :lvm,
"used_by_device" => "",
Expand All @@ -69,17 +69,17 @@
}
],
"pe_free" => 1,
"pesize" => 4194304,
"size_k" => 7974912,
"pesize" => 4_194_304,
"size_k" => 7_974_912,
"type" => :CT_LVM,
"used_by_device" => "",
"used_by_type" => :UB_NONE
},
"/dev/vda" => {
"bios_id" => "0x80",
"bus" => "None",
"cyl_count" => 1044,
"cyl_size" => 8225280,
"cyl_count" => 1_044,
"cyl_size" => 8_225_280,
"device" => "/dev/vda",
"driver" => "virtio-pci",
"driver_module" => "virtio_pci",
Expand All @@ -96,7 +96,7 @@
"name" => "vda1",
"nr" => 1,
"region" => [0, 51],
"size_k" => 408576,
"size_k" => 408_576,
"type" => :primary,
"used_by_device" => "",
"used_by_type" => :UB_NONE
Expand All @@ -110,7 +110,7 @@
"name" => "vda2",
"nr" => 2,
"region" => [50, 994],
"size_k" => 7977984,
"size_k" => 7_977_984,
"type" => :primary,
"used_by" => [{ "device" => "/dev/system", "type" => :UB_LVM }],
"used_by_device" => "/dev/system",
Expand All @@ -119,7 +119,7 @@
],
"proposal_name" => "1. Disk, 8.00 GiB, /dev/vda, ",
"sector_size" => 512,
"size_k" => 8388608,
"size_k" => 8_388_608,
"transport" => :unknown,
"type" => :CT_DISK,
"unique" => "KSbE.Fxp0d3BezAE",
Expand Down

0 comments on commit c060aa2

Please sign in to comment.