Sha256: 5753c173d9afe09d799eee61800bfb145d906909b5d8a9894756ce7d393e77a9

Contents?: true

Size: 563 Bytes

Versions: 21

Compression:

Stored size: 563 Bytes

Contents

module LinuxAdmin
  class Volume
    private

    def self.process_volume_display_line(line)
      groups = VolumeGroup.scan
      fields = line.split(':')
      vgname = fields[1]
      vg = groups.find { |g| g.name == vgname }
      return fields, vg
    end

    protected

    def self.scan_volumes(cmd)
      volumes = []

      out = Common.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

21 entries across 21 versions & 1 rubygems

Version Path
linux_admin-4.0.0 lib/linux_admin/volume.rb
linux_admin-3.0.0 lib/linux_admin/volume.rb
linux_admin-2.0.2 lib/linux_admin/volume.rb
linux_admin-2.0.1 lib/linux_admin/volume.rb
linux_admin-2.0.0 lib/linux_admin/volume.rb
linux_admin-1.2.4 lib/linux_admin/volume.rb
linux_admin-1.2.3 lib/linux_admin/volume.rb
linux_admin-1.2.2 lib/linux_admin/volume.rb
linux_admin-1.2.1 lib/linux_admin/volume.rb
linux_admin-1.0.1 lib/linux_admin/volume.rb
linux_admin-1.2.0 lib/linux_admin/volume.rb
linux_admin-1.1.0 lib/linux_admin/volume.rb
linux_admin-1.0.0 lib/linux_admin/volume.rb
linux_admin-0.20.2 lib/linux_admin/volume.rb
linux_admin-0.20.1 lib/linux_admin/volume.rb
linux_admin-0.20.0 lib/linux_admin/volume.rb
linux_admin-0.19.0 lib/linux_admin/volume.rb
linux_admin-0.18.0 lib/linux_admin/volume.rb
linux_admin-0.17.0 lib/linux_admin/volume.rb
linux_admin-0.16.0 lib/linux_admin/volume.rb