Sha256: fecc60746cdd20947f24476ba747f10513139f4690063707dca5b6ebd90c43c0

Contents?: true

Size: 1.22 KB

Versions: 9

Compression:

Stored size: 1.22 KB

Contents

require 'metadata/MIQExtract/MIQExtract'
require 'log4r'
require 'MiqVm/MiqVm'

# vmDir = "v:"
vmDir = File.join(ENV.fetch("HOME", '.'), 'VMs')
puts "vmDir = #{vmDir}"

class ConsoleFormatter < Log4r::Formatter
  def format(event)
    (event.data.kind_of?(String) ? event.data : event.data.inspect) + "\n"
  end
end

toplog = Log4r::Logger.new 'toplog'
Log4r::StderrOutputter.new('err_console', :level => Log4r::ERROR, :formatter => ConsoleFormatter)
toplog.add 'err_console'
$log = toplog if $log.nil?

#
# *** Test start
#

# vmCfgFile = File.join(vmDir, "UbuntuDev.vmwarevm/UbuntuDev.vmx")
# vmCfgFile = File.join(vmDir, "gentoo/gentoo.vmx")
# vmCfgFile = File.join(vmDir, "Ken_Linux/Ken_Linux.vmx")
# vmCfgFile = File.join(vmDir, "Metasploit VM/Metasploit VM.vmx")
# vmCfgFile = File.join(vmDir, "KnopDev.vmwarevm/KnopDev.vmx")
vmCfgFile = File.join(vmDir, "Red Hat Linux.vmwarevm/Red Hat Linux.vmx")
# vmCfgFile = File.join(vmDir, "MIQ Server Appliance - Ubuntu MD - small/MIQ Server Appliance - Ubuntu.vmx")
# vmCfgFile = File.join(vmDir, "winxpDev.vmwarevm/winxpDev.vmx")
puts "VM config file: #{vmCfgFile}"

ost = OpenStruct.new
vmCfg = MIQExtract.new(vmCfgFile, ost)
xml = vmCfg.extract(["software"])

xml.write($stdout, 4)
puts

vmCfg.close

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
manageiq-smartstate-0.2.1 lib/metadata/MIQExtract/test/extractTest.rb
manageiq-smartstate-0.2.0 lib/metadata/MIQExtract/test/extractTest.rb
manageiq-smartstate-0.1.6 lib/metadata/MIQExtract/test/extractTest.rb
manageiq-smartstate-0.1.5 lib/metadata/MIQExtract/test/extractTest.rb
manageiq-smartstate-0.1.4 lib/metadata/MIQExtract/test/extractTest.rb
manageiq-smartstate-0.1.3 lib/metadata/MIQExtract/test/extractTest.rb
manageiq-smartstate-0.1.2 lib/metadata/MIQExtract/test/extractTest.rb
manageiq-smartstate-0.1.1 lib/metadata/MIQExtract/test/extractTest.rb
manageiq-smartstate-0.1.0 lib/metadata/MIQExtract/test/extractTest.rb