2011-06-28 15:47:16 +02:00
|
|
|
require "rexml/document"
|
|
|
|
require 'erb'
|
2011-08-03 12:48:44 +02:00
|
|
|
require 'ostruct'
|
2011-06-28 15:47:16 +02:00
|
|
|
|
|
|
|
module Fog
|
|
|
|
module Compute
|
|
|
|
module LibvirtUtil
|
|
|
|
|
|
|
|
# finds a value from xml
|
|
|
|
def document path, attribute=nil
|
|
|
|
return nil if new?
|
|
|
|
xml = REXML::Document.new(@xml_desc)
|
|
|
|
attribute.nil? ? xml.elements[path].text : xml.elements[path].attributes[attribute]
|
|
|
|
end
|
2011-08-08 15:22:55 -06:00
|
|
|
|
2011-08-03 12:48:44 +02:00
|
|
|
class ErbBinding < OpenStruct
|
|
|
|
def get_binding
|
|
|
|
return binding()
|
|
|
|
end
|
|
|
|
end
|
2011-08-08 15:22:55 -06:00
|
|
|
|
|
|
|
|
2011-06-28 15:47:16 +02:00
|
|
|
end
|
|
|
|
end
|
2011-08-08 15:18:03 -06:00
|
|
|
end
|