Class: LVM::Wrapper::VGS
- Inherits:
-
Object
- Object
- LVM::Wrapper::VGS
- Includes:
- Reporting
- Defined in:
- lib/lvm/wrapper/vgs.rb
Constant Summary collapse
- BASE_COMMAND =
"vgs #{Reporting::BASE_ARGUMENTS}".freeze
- ATTRIBUTES_FILE =
"vgs.yaml".freeze
- PERMISSIONS =
vg_attr attribute handling constants roughly by order referenced in lib/report/report.c:360 (_vgstatus_disp)
{ "w" => :writeable, "r" => :readonly, }.freeze
- RESIZEABLE =
{ # code says its a boolean "z" => true, }.freeze
- EXPORTED =
{ # code says its a boolean "x" => true, }.freeze
- PARTIAL =
{ # code says its a boolean "p" => true, }.freeze
- ALLOCATION_POLICY =
{ "c" => :contiguous, "l" => :cling, "n" => :normal, "a" => :anywhere, "i" => :inherited, "C" => :contiguous_locked, "L" => :cling_locked, "N" => :normal_locked, "A" => :anywhere_locked, "I" => :inherited_locked, }.freeze
- CLUSTERED =
{ # code says its a boolean "c" => true, }.freeze
Constants included from Reporting::Constants
Reporting::Constants::BASE_ARGUMENTS, Reporting::Constants::EMPTY, Reporting::Constants::SEPERATOR
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#command ⇒ Object
readonly
Returns the value of attribute command.
Instance Method Summary collapse
-
#initialize(options) ⇒ VGS
constructor
A new instance of VGS.
- #list ⇒ Object
Methods included from Reporting
Constructor Details
#initialize(options) ⇒ VGS
Returns a new instance of VGS.
12 13 14 15 |
# File 'lib/lvm/wrapper/vgs.rb', line 12 def initialize() @attributes = Attributes.load([:version], ATTRIBUTES_FILE) @command = "#{options[:command]} #{Reporting.build_command(attributes, BASE_COMMAND, options[:additional_arguments])}" end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
9 10 11 |
# File 'lib/lvm/wrapper/vgs.rb', line 9 def attributes @attributes end |
#command ⇒ Object (readonly)
Returns the value of attribute command.
10 11 12 |
# File 'lib/lvm/wrapper/vgs.rb', line 10 def command @command end |
Instance Method Details
#list ⇒ Object
56 57 58 59 60 61 62 63 64 |
# File 'lib/lvm/wrapper/vgs.rb', line 56 def list output = External.cmd(@command) data = parse(output) if block_given? data.each { |obj| yield obj } else data end end |