occi 2.5.10 → 2.5.11
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/lib/occi/parser.rb +8 -4
- data/lib/occi/version.rb +1 -1
- metadata +2 -2
data/lib/occi/parser.rb
CHANGED
@@ -90,7 +90,7 @@ module OCCI
|
|
90
90
|
entity.links = []
|
91
91
|
link_strings = header['HTTP_LINK'].to_s.split(',')
|
92
92
|
link_strings.each do |link_string|
|
93
|
-
link
|
93
|
+
link = OCCIANTLR::Parser.new('Link: ' + link_string).link
|
94
94
|
link.attributes!.occi!.core!.target = link.target
|
95
95
|
entity.links << OCCI::Core::Link.new(link.kind, link.mixins, link.attributes, link.actions, link.rel)
|
96
96
|
end
|
@@ -233,7 +233,11 @@ module OCCI
|
|
233
233
|
doc.xpath('envelope:Envelope/envelope:References/envelope:File', 'envelope' => "#{Parser::OVF}").each do |file|
|
234
234
|
href = URI.parse(file.attributes['href'].to_s)
|
235
235
|
if href.relative?
|
236
|
-
|
236
|
+
if files[href.to_s]
|
237
|
+
references[file.attributes['id'].to_s] = 'file://' + files[href.to_s]
|
238
|
+
else
|
239
|
+
references[file.attributes['id'].to_s] = 'file://' + href.to_s
|
240
|
+
end
|
237
241
|
else
|
238
242
|
references[file.attributes['id'].to_s] = href.to_s
|
239
243
|
end
|
@@ -242,7 +246,7 @@ module OCCI
|
|
242
246
|
doc.xpath('envelope:Envelope/envelope:DiskSection/envelope:Disk', 'envelope' => "#{Parser::OVF}").each do |disk|
|
243
247
|
storage = OCCI::Core::Resource.new('http://schemas.ogf.org/occi/infrastructure#storage')
|
244
248
|
if disk.attributes['fileRef']
|
245
|
-
storagelink
|
249
|
+
storagelink = OCCI::Core::Link.new("http://schemas.ogf.org/occi/infrastructure#storagelink")
|
246
250
|
storagelink.attributes.occi!.core!.title = disk.attributes['fileRef'].to_s
|
247
251
|
storagelink.attributes.occi!.core!.target = references[disk.attributes['fileRef'].to_s]
|
248
252
|
storage.attributes.occi!.core!.title = disk.attributes['diskId'].to_s
|
@@ -304,7 +308,7 @@ module OCCI
|
|
304
308
|
# extract the mountpoint
|
305
309
|
host_resource = resource_alloc.xpath("item:HostResource/text()", 'item' => "#{Parser::RASD}").to_s
|
306
310
|
if host_resource.start_with? 'ovf:/disk/'
|
307
|
-
id
|
311
|
+
id = host_resource.gsub('ovf:/disk/', '')
|
308
312
|
storage = collection.resources.select { |resource| resource.attributes.occi!.core!.title == id }.first
|
309
313
|
raise "Disk with id #{id} not found" unless storage
|
310
314
|
storagelink.attributes.occi!.core!.target = storage.location
|
data/lib/occi/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: occi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.5.
|
4
|
+
version: 2.5.11
|
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: 2012-09-
|
13
|
+
date: 2012-09-13 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: json
|