Skip to content

VolumeGroup#scan doesn't strip leading whitespace when parsing the name #44

@jrafanie

Description

@jrafanie
# vgcreate vg_data /dev/sdb1
  Volume group "vg_data" successfully created

# bundle console
irb(main):001:0> require 'linux_admin'
=> true
irb(main):002:0> vg = LinuxAdmin::VolumeGroup.scan.first
=> #<LinuxAdmin::VolumeGroup:0x00000003178bf0 @name="  vg_data">
irb(main):003:0> vg.name
=> "  vg_data"

This causes LogicalVolume.create to fail:

irb(main):03:0> begin;  LinuxAdmin::LogicalVolume.create("lv_pg", vg, (LinuxAdmin::Disk.local.first.size / 1.megabytes).to_i - 1.megabyte); rescue => err; puts err.result.inspect; end
#<CommandResult:0x00000004f123c8 @output="", @error="  Volume group name   vg_data has invalid characters\n  Run `lvcreate --help' for more information.\n", @exit_status=3>

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions