Revision c25a863c src/vmm_mad/remotes/lib/vcenter_driver/vi_helper.rb

View differences:

src/vmm_mad/remotes/lib/vcenter_driver/vi_helper.rb
1 1
module VCenterDriver
2 2

  
3 3
class VIHelper
4

  
5
    ETC_LOCATION = "/etc/one/" if !defined?(ETC_LOCATION)
6
    VCENTER_DRIVER_DEFAULT = "#{ETC_LOCATION}/vcenter_driver.default"
7

  
4 8
    def self.client
5 9
        @@client ||= OpenNebula::Client.new
6 10
    end
......
54 58
        return element
55 59
    end
56 60

  
61
    def self.get_default(xpath)
62
        begin
63
            xml = OpenNebula::XMLElement.new
64
            xml.initialize_xml(File.read(VCENTER_DRIVER_DEFAULT), 'VCENTER')
65
            return xml[xpath]
66
        rescue
67
            return nil
68
        end
69
    end
70

  
57 71
end # class VIHelper
58 72

  
59 73
end # module VCenterDriver

Also available in: Unified diff