ovfparse 0.6.9 → 0.7.26
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/ovfparse/vmpackage.rb +7 -2
- metadata +5 -5
data/lib/ovfparse/vmpackage.rb
CHANGED
|
@@ -234,7 +234,13 @@ class VmPackage
|
|
|
234
234
|
}
|
|
235
235
|
|
|
236
236
|
getChildrenByName(diskSection, 'Disk').each { |node|
|
|
237
|
-
|
|
237
|
+
capacity = node['capacity']
|
|
238
|
+
units = node['capacityAllocationUnits']
|
|
239
|
+
if(units == "byte * 2^30")
|
|
240
|
+
capacity = (capacity.to_i * 1073741824).to_s
|
|
241
|
+
end
|
|
242
|
+
thin_size = node['populatedSize']
|
|
243
|
+
disks.push({ 'name' => node['diskId'], 'location' => filenames[node['fileRef']], 'size' => capacity, 'thin_size' => (thin_size || "-1") })
|
|
238
244
|
}
|
|
239
245
|
|
|
240
246
|
return disks
|
|
@@ -652,7 +658,6 @@ end
|
|
|
652
658
|
class HttpVmPackage < VmPackage
|
|
653
659
|
def fetch
|
|
654
660
|
url = URI.parse(URI.escape(self.uri))
|
|
655
|
-
|
|
656
661
|
@xml = Nokogiri::XML(open(url)) do |config|
|
|
657
662
|
config.noblanks.strict.noent
|
|
658
663
|
end
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ovfparse
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
hash:
|
|
4
|
+
hash: 55
|
|
5
5
|
prerelease:
|
|
6
6
|
segments:
|
|
7
7
|
- 0
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
version: 0.
|
|
8
|
+
- 7
|
|
9
|
+
- 26
|
|
10
|
+
version: 0.7.26
|
|
11
11
|
platform: ruby
|
|
12
12
|
authors:
|
|
13
13
|
- Jim Barkley
|
|
@@ -15,7 +15,7 @@ autorequire:
|
|
|
15
15
|
bindir: bin
|
|
16
16
|
cert_chain: []
|
|
17
17
|
|
|
18
|
-
date: 2011-
|
|
18
|
+
date: 2011-07-26 00:00:00 -04:00
|
|
19
19
|
default_executable:
|
|
20
20
|
dependencies:
|
|
21
21
|
- !ruby/object:Gem::Dependency
|