Sha256: 78e8c2ab91df75da74e22a4233f131b0255028655da5f7ad0d84265e848ca6e3
Contents?: true
Size: 686 Bytes
Versions: 19
Compression:
Stored size: 686 Bytes
Contents
# LinuxAdmin Logical Volume Representation # # Copyright (C) 2013 Red Hat Inc. # Licensed under the MIT License class LinuxAdmin class Volume < LinuxAdmin private def self.process_volume_display_line(line) groups = VolumeGroup.scan fields = line.split(':') vgname = fields[1] vg = groups.find { |vg| vg.name == vgname } return fields, vg end protected def self.scan_volumes(cmd) volumes = [] out = run!(cmd, :params => { '-c' => nil}).output out.each_line do |line| fields, vg = process_volume_display_line(line.lstrip) volumes << yield(fields, vg) end volumes end end end
Version data entries
19 entries across 19 versions & 1 rubygems