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

Version Path
linux_admin-0.9.1 lib/linux_admin/volume.rb
linux_admin-0.9.0 lib/linux_admin/volume.rb
linux_admin-0.8.1 lib/linux_admin/volume.rb
linux_admin-0.8.0 lib/linux_admin/volume.rb
linux_admin-0.7.0 lib/linux_admin/volume.rb
linux_admin-0.6.0 lib/linux_admin/volume.rb
linux_admin-0.5.7 lib/linux_admin/volume.rb
linux_admin-0.5.6 lib/linux_admin/volume.rb
linux_admin-0.5.5 lib/linux_admin/volume.rb
linux_admin-0.5.4 lib/linux_admin/volume.rb
linux_admin-0.5.3 lib/linux_admin/volume.rb
linux_admin-0.5.2 lib/linux_admin/volume.rb
linux_admin-0.5.1 lib/linux_admin/volume.rb
linux_admin-0.5.0 lib/linux_admin/volume.rb
linux_admin-0.4.1 lib/linux_admin/volume.rb
linux_admin-0.4.0 lib/linux_admin/volume.rb
linux_admin-0.3.0 lib/linux_admin/volume.rb
linux_admin-0.2.3 lib/linux_admin/volume.rb
linux_admin-0.2.2 lib/linux_admin/volume.rb