rbvmomi 1.8.0 → 1.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.8.0
1
+ 1.8.1
@@ -102,6 +102,13 @@ class CachedOvfDeployer
102
102
  # simplicity this function assumes we need to read the OVF file
103
103
  # ourselves to know the names, and we map all of them to the same
104
104
  # VIM::Network.
105
+
106
+ # If we're handling a file:// URI we need to strip the scheme as open-uri
107
+ # can't handle them.
108
+ if URI(ovf_url).scheme == "file" && URI(ovf_url).host.nil?
109
+ ovf_url = URI(ovf_url).path
110
+ end
111
+
105
112
  ovf = open(ovf_url, 'r'){|io| Nokogiri::XML(io.read)}
106
113
  ovf.remove_namespaces!
107
114
  networks = ovf.xpath('//NetworkSection/Network').map{|x| x['name']}
@@ -206,7 +213,7 @@ class CachedOvfDeployer
206
213
  # or nil
207
214
  def lookup_template template_name
208
215
  template_path = "#{template_name}-#{@computer.name}"
209
- template = @template_folder.traverse(template_path, VIM::VirtualMachine)
216
+ template = @template_folder.traverse(template_path, RbVmomi::VIM::VirtualMachine)
210
217
  if template
211
218
  config = template.config
212
219
  is_template = config && config.template
@@ -97,12 +97,12 @@ class VIM < Connection
97
97
  def get_log_lines logKey, lines=5, start=nil, host=nil
98
98
  diagMgr = self.serviceContent.diagnosticManager
99
99
  if !start
100
- log = diagMgr.BrowseDiagnosticLog(host: host, key: logKey, start: 999999999)
100
+ log = diagMgr.BrowseDiagnosticLog(:host => host, :key => logKey, :start => 999999999)
101
101
  lineEnd = log.lineEnd
102
102
  start = lineEnd - lines
103
103
  end
104
104
  start = start < 0 ? 0 : start
105
- log = diagMgr.BrowseDiagnosticLog(host: host, key: logKey, start: start)
105
+ log = diagMgr.BrowseDiagnosticLog(:host => host, :key => logKey, :start => start)
106
106
  if log.lineText.size > 0
107
107
  [log.lineText.slice(-lines, log.lineText.size), log.lineEnd]
108
108
  else
@@ -113,7 +113,7 @@ class VIM < Connection
113
113
  def get_log_keys host=nil
114
114
  diagMgr = self.serviceContent.diagnosticManager
115
115
  keys = []
116
- diagMgr.QueryDescriptions(host: host).each do |desc|
116
+ diagMgr.QueryDescriptions(:host => host).each do |desc|
117
117
  keys << "#{desc.key}"
118
118
  end
119
119
  keys
@@ -95,13 +95,17 @@ class RbVmomi::VIM::OvfManager
95
95
  raise "Couldn't find deviceURL for device '#{fileItem.deviceId}'"
96
96
  end
97
97
 
98
- # XXX handle file:// URIs
99
98
  ovfFilename = opts[:uri].to_s
100
99
  tmp = ovfFilename.split(/\//)
101
100
  tmp.pop
102
101
  tmp << fileItem.path
103
102
  filename = tmp.join("/")
104
103
 
104
+ # If filename doesn't have a URI scheme, we're considering it a local file
105
+ if URI(filename).scheme.nil?
106
+ filename = "file://" + filename
107
+ end
108
+
105
109
  method = fileItem.create ? "PUT" : "POST"
106
110
 
107
111
  keepAliveThread = Thread.new do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbvmomi
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.0
4
+ version: 1.8.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-12-18 00:00:00.000000000 Z
13
+ date: 2013-12-19 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: nokogiri