rbovirt 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 58cb5fab7fdfa1f4dce04d45532618c7415c8be5
4
- data.tar.gz: ad23cc3fa62db7186b4bf14ae198f5d7e95c74bb
3
+ metadata.gz: 176f8a221ec21197b316ac5b673573649353db2e
4
+ data.tar.gz: b0d2e1cd49e4013cd1a22cd0f1dac7ad5ce599f1
5
5
  SHA512:
6
- metadata.gz: 22b5ba8ada4d36d8ece11c9be5520188385c6978c80bdee0640b5fe898b559af46a6dd450d4e0b4195e36e3603d027722dc0197fff191c47e01cf789b3d6dde8
7
- data.tar.gz: 47ba3a1763257b788c3bba4eb5596be1dbed85e36345f4f6a4c7ffaaca9cf97cd96024412020fbcb620f95412c1dd3e85f77e210a0e531f9115645d9c87e0c95
6
+ metadata.gz: 6646f08fe9c3faba1af5234a7807f315198cc76fc32d5ed2355f7c27ee042a6a08a94f4f729d18fe7e4e70cefdb7e83667ebe2a6560810bb3d99e23544722ff0
7
+ data.tar.gz: f91d2c1333728938ec6fdb47eab1c6c262cea1196bf60ba5c7165ebcc2f2ba1024226ce8aa1b4eac660308bff10292f2d8b8f60bab1948029834768b1964ae25
@@ -1,3 +1,3 @@
1
1
  module OVIRT
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -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)
@@ -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.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-04-25 00:00:00.000000000 Z
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.0.14
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
- has_rdoc:
177
+ - spec/unit/volume_spec.rb