rbovirt 0.1.1 → 0.1.2
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.
- checksums.yaml +4 -4
- data/lib/ovirt/version.rb +1 -1
- data/lib/ovirt/volume.rb +2 -2
- data/lib/rbovirt.rb +2 -1
- data/spec/unit/volume_spec.rb +26 -0
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 176f8a221ec21197b316ac5b673573649353db2e
|
4
|
+
data.tar.gz: b0d2e1cd49e4013cd1a22cd0f1dac7ad5ce599f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6646f08fe9c3faba1af5234a7807f315198cc76fc32d5ed2355f7c27ee042a6a08a94f4f729d18fe7e4e70cefdb7e83667ebe2a6560810bb3d99e23544722ff0
|
7
|
+
data.tar.gz: f91d2c1333728938ec6fdb47eab1c6c262cea1196bf60ba5c7165ebcc2f2ba1024226ce8aa1b4eac660308bff10292f2d8b8f60bab1948029834768b1964ae25
|
data/lib/ovirt/version.rb
CHANGED
data/lib/ovirt/volume.rb
CHANGED
@@ -56,8 +56,8 @@ module OVIRT
|
|
56
56
|
@storage_domain = ((xml/'storage_domains/storage_domain').first[:id] rescue nil)
|
57
57
|
@size = (xml/'size').first.text
|
58
58
|
@disk_type = ((xml/'type').first.text rescue nil)
|
59
|
-
@bootable = (xml/'bootable').first.text
|
60
|
-
@interface = (xml/'interface').first.text
|
59
|
+
@bootable = ((xml/'bootable').first.text rescue nil)
|
60
|
+
@interface = ((xml/'interface').first.text rescue nil)
|
61
61
|
@format = ((xml/'format').first.text rescue nil)
|
62
62
|
@sparse = ((xml/'sparse').first.text rescue nil)
|
63
63
|
@status = ((xml/'status/state').first.text rescue nil)
|
data/lib/rbovirt.rb
CHANGED
@@ -147,7 +147,7 @@ module OVIRT
|
|
147
147
|
def http_delete(suburl, body=nil, headers={})
|
148
148
|
begin
|
149
149
|
headers = body ? http_headers(headers) :
|
150
|
-
{:accept => 'application/xml'}.merge(auth_header).merge(filter_header)
|
150
|
+
{:accept => 'application/xml', :version => '3'}.merge(auth_header).merge(filter_header)
|
151
151
|
handle_success(rest_client(suburl).delete_with_payload(body, headers))
|
152
152
|
rescue
|
153
153
|
handle_fault $!
|
@@ -197,6 +197,7 @@ module OVIRT
|
|
197
197
|
filter_header.merge(auth_header).merge({
|
198
198
|
:content_type => 'application/xml',
|
199
199
|
:accept => 'application/xml',
|
200
|
+
:version => '3',
|
200
201
|
}).merge(headers)
|
201
202
|
end
|
202
203
|
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require "#{File.dirname(__FILE__)}/../spec_helper"
|
2
|
+
|
3
|
+
describe OVIRT::Volume do
|
4
|
+
|
5
|
+
xml = <<END_HEREDOC
|
6
|
+
<disk href="/api/vms/76d29095-bc27-4cd0-8178-07e942aea549/nics/12345678-1234-1234-1234-123456789012" id="12345678-1234-1234-1234-123456789012">
|
7
|
+
<name>disk1</name>
|
8
|
+
<size>53687091200</size>
|
9
|
+
<provisioned_size>53687091200</provisioned_size>
|
10
|
+
<actual_size>143360</actual_size>
|
11
|
+
<shareable>false</shareable>
|
12
|
+
<propagate_errors>false</propagate_errors>
|
13
|
+
<active>true</active>
|
14
|
+
</disk>
|
15
|
+
END_HEREDOC
|
16
|
+
vol = OVIRT::Volume::new(nil, Nokogiri::XML(xml).xpath('/').first)
|
17
|
+
|
18
|
+
it "volume's bootable should be nil, since it was not specified" do
|
19
|
+
vol.bootable.should eql(nil)
|
20
|
+
end
|
21
|
+
|
22
|
+
it "volume's interface should be nil, since it was not specified" do
|
23
|
+
vol.interface.should eql(nil)
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rbovirt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Amos Benari
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-08-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -135,6 +135,7 @@ files:
|
|
135
135
|
- spec/spec_helper.rb
|
136
136
|
- spec/unit/client_spec.rb
|
137
137
|
- spec/unit/vm_spec.rb
|
138
|
+
- spec/unit/volume_spec.rb
|
138
139
|
homepage: http://github.com/abenari/rbovirt
|
139
140
|
licenses:
|
140
141
|
- MIT
|
@@ -161,7 +162,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
161
162
|
version: '0'
|
162
163
|
requirements: []
|
163
164
|
rubyforge_project:
|
164
|
-
rubygems_version: 2.
|
165
|
+
rubygems_version: 2.5.1
|
165
166
|
signing_key:
|
166
167
|
specification_version: 4
|
167
168
|
summary: A Ruby client for oVirt REST API
|
@@ -173,4 +174,4 @@ test_files:
|
|
173
174
|
- spec/spec_helper.rb
|
174
175
|
- spec/unit/client_spec.rb
|
175
176
|
- spec/unit/vm_spec.rb
|
176
|
-
|
177
|
+
- spec/unit/volume_spec.rb
|