class Lsmpio_entry

Attributes

connection[R]
connection_disk[R]
connection_port[R]
name[R]
parent[R]
path_id[R]
path_status[R]
status[R]
string_raw[R]
viosname[W]

Public Class Methods

new(string = '') click to toggle source
# File lib/AIX/lsmpio_entry.rb, line 15
def initialize(string = '')
  @string_raw = ''
  @_parsed = false
  parse(string) unless string.empty?
end

Public Instance Methods

parse(string) click to toggle source
# File lib/AIX/lsmpio_entry.rb, line 21
def parse(string)
  @string_raw = string

  regexp = %r{(hdisk\d+)\s+(\d+)\s+(Enabled|Disabled|Failed|Missing)\s+([\w\,]+)\s+(fscsi\d+)\s+(\w+)\,(\w+)}

  if match = regexp.match(string)
    @name = match[1]
    @path_id = match[2].to_i
    @status = match[3]
    @path_status = match[4]
    @parent = match[5]
    @connection = match[6] + ',' + match[7]
    @connection_port = match[6]
    @connection_disk = match[7]
  else
    print "Wrong line:>" + line + "<\n"
  end
end
to_s(space1_size, space2_size) click to toggle source
# File lib/AIX/lsmpio_entry.rb, line 40
def to_s(space1_size, space2_size)

  "#{@name}  #{@path_id}   #{@status} #{@path_status} #{@parent} #{@connection}"
end