Sha256: 81956286aba42827e20225181f334df1cd671ee692aa13ddd477986f4f1f2490
Contents?: true
Size: 654 Bytes
Versions: 1
Compression:
Stored size: 654 Bytes
Contents
module OpenVZ class Inventory < ConfigHash def initialize() @vzlist = "/usr/sbin/vzlist" end def load Util.execute("#{@vzlist} -a").each { |l| # inventarize a container object for each avaiable container. if l =~ /^\s+(\d+)\s+(.*)\s+(running|stopped)\s+(.*)\s\s(.*)$/ self[$1] = Container.new($1) end } end # Returns cotainers' id as a array of strings def ids Util.execute("#{@vzlist} -a1").split end def to_hash @data end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
openvz-1.5.3 | lib/openvz/inventory.rb |