Sha256: 53acf3369871d29c661417b8223d4dae4572ab0495d5bce2c871cec1cd0e7596

Contents?: true

Size: 679 Bytes

Versions: 1

Compression:

Stored size: 679 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)
        volumes << yield(fields, vg)
      end

      volumes
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
linux_admin-0.2.1 lib/linux_admin/volume.rb