ovirt-engine-sdk 4.2.0.alpha1 → 4.2.0.alpha2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 734038b717ae55b9d1335c8740cfdbd5ed1f0b3f
4
- data.tar.gz: e3cf776841605c2a8cd66fdb77e37fde1b09a8d0
3
+ metadata.gz: 40908e6b88b521aaf3a23e7c0580a1048f6c8ffd
4
+ data.tar.gz: e8acc264e9fb9d97b492fbb9981b107296f336e1
5
5
  SHA512:
6
- metadata.gz: ee1b0abae867f5b48a430a02d257d6d9f723da92256a4a9141b1252d88be0a0169679b2d929aad9ead3eabaa9c43c55c2bcf7bfdc4357841b1152f5034ed9b96
7
- data.tar.gz: 786ded331b9d30f7cfa99437d98bd6be32ef2d189837ae24b8fa2de8d35664974d90cf225df2f45eb6e5143bee2ec810d75b7e7219f95ae67a684f7a265cc596
6
+ metadata.gz: bcac4e7e89424f3ededf6541482a49f2f219597658c8d91faa6fe40d8e0f7c0aea0a97415c5cb8b039e835af9e4931ed1e56e2a394f95e833fb59b834e7728f7
7
+ data.tar.gz: 1d844327f93a72ca2ecdd893cdefa40befb17f3e8d73bd396e46de8e1a103673d7fbf9884058adf6d4ee3362b5c2e7503e028fc87eecd2b7f00379da4b409d53
@@ -2,6 +2,20 @@
2
2
 
3
3
  This document describes the relevant changes between releases of the SDK.
4
4
 
5
+ == 4.2.0-alpha2 / Jul 21 2017
6
+
7
+ New features:
8
+
9
+ * Add a method to Probe to check whether an ovirt instance exists.
10
+
11
+ Bug fixes:
12
+
13
+ * Changing 'bundler' executable instead of 'bundle'
14
+ https://bugzilla.redhat.com/1462664[1462664].
15
+
16
+ * Ignore unrelated responses from server
17
+ https://bugzilla.redhat.com/1459254[1459254].
18
+
5
19
  == 4.2.0-alpha1 / Jun 6 2017
6
20
 
7
21
  Bug fixes:
@@ -311,9 +311,17 @@ static void* ov_http_client_header_task(void* data) {
311
311
  /* We should always tell the library that we processed all the data: */
312
312
  context_ptr->result = context_ptr->size * context_ptr->nitems;
313
313
 
314
- /* Remove trailing white space: */
314
+ /* The library provides the headers for all the responses it receives, including the responses for intermediate
315
+ requests used for authentication negotation. We are interested only in the headers of the last response, so
316
+ if the given data is the begin of a new response, we clear the headers hash. */
315
317
  length = context_ptr->result;
316
318
  buffer = context_ptr->buffer;
319
+ if (length >= 5 && strncmp("HTTP/", buffer, 5) == 0) {
320
+ rb_hash_clear(response_ptr->headers);
321
+ return NULL;
322
+ }
323
+
324
+ /* Remove trailing white space: */
317
325
  while (length > 0 && isspace(buffer[length - 1])) {
318
326
  length--;
319
327
  }
@@ -67,6 +67,45 @@ module OvirtSDK4
67
67
  end
68
68
  end
69
69
 
70
+ ENGINE_CERTIFICATE_PATH =
71
+ '/ovirt-engine/services/pki-resource?resource=engine-certificate&format=OPENSSH-PUBKEY'.freeze
72
+
73
+ #
74
+ # This class method receives a set of options that define the server to probe and returns a boolean value
75
+ # that represents whether an oVirt instance was detected.
76
+ #
77
+ # @param opts [Hash] The options used to create the probe.
78
+ #
79
+ # @option opts [String] :host The name or IP address of the host to probe.
80
+ #
81
+ # @option opts [Integer] :port (443) The port number to probe.
82
+ #
83
+ # @option opts [String] :log The logger where the log messages will be written.
84
+ #
85
+ # @option opts [Boolean] :debug (false) A boolean flag indicating if debug output should be generated. If the
86
+ # values is `true` and the `log` parameter isn't `nil` then the data sent to and received from the server will
87
+ # be written to the log. Be aware that user names and passwords will also be written, so handle with care.
88
+ #
89
+ # @option opts [String] :proxy_url A string containing the protocol, address and port number of the proxy server
90
+ # to use to connect to the server. For example, in order to use the HTTP proxy `proxy.example.com` that is
91
+ # listening on port `3128` the value should be `http://proxy.example.com:3128`. This is optional, and if not
92
+ # given the connection will go directly to the server specified in the `url` parameter.
93
+ #
94
+ # @option opts [Integer] :timeout (0) Set a connection timeout, in seconds. If the value is 0 no timeout is set.
95
+ #
96
+ # @return [Boolean] Boolean value, `true` if an oVirt instance was detected.
97
+ #
98
+ def self.exists?(opts)
99
+ probe = nil
100
+ begin
101
+ opts[:insecure] = true
102
+ probe = Probe.new(opts)
103
+ probe.exists?
104
+ ensure
105
+ probe.close if probe
106
+ end
107
+ end
108
+
70
109
  #
71
110
  # Creates a new probe.
72
111
  #
@@ -117,6 +156,7 @@ module OvirtSDK4
117
156
  @proxy_url = opts[:proxy_url]
118
157
  @proxy_username = opts[:proxy_username]
119
158
  @proxy_password = opts[:proxy_password]
159
+ @timeout = opts[:timeout]
120
160
 
121
161
  # Create the HTTP client:
122
162
  @client = HttpClient.new(
@@ -128,7 +168,8 @@ module OvirtSDK4
128
168
  debug: @debug,
129
169
  proxy_url: @proxy_url,
130
170
  proxy_username: @proxy_username,
131
- proxy_password: @proxy_password
171
+ proxy_password: @proxy_password,
172
+ timeout: @timeout
132
173
  )
133
174
  end
134
175
 
@@ -145,6 +186,18 @@ module OvirtSDK4
145
186
  detect_version(path).map { |version| ProbeResult.new(version: version) }
146
187
  end
147
188
 
189
+ #
190
+ # Probes the server to detect if it has an ovirt instance running on it
191
+ #
192
+ # @return [Boolean] `true` if oVirt instance was detected, false otherwise
193
+ #
194
+ # @api private
195
+ #
196
+ def exists?
197
+ response = send(path: ENGINE_CERTIFICATE_PATH)
198
+ response.code == 200
199
+ end
200
+
148
201
  #
149
202
  # Releases the resources used by this probe.
150
203
  #
@@ -184,8 +237,8 @@ module OvirtSDK4
184
237
 
185
238
  # Set authentication:
186
239
  request.username = @username
187
- request.password = @password
188
240
 
241
+ request.password = @password
189
242
  # Send the request and wait for the response:
190
243
  @client.send(request)
191
244
  response = @client.wait(request)
@@ -16,5 +16,5 @@
16
16
 
17
17
 
18
18
  module OvirtSDK4
19
- VERSION = '4.2.0.alpha1'.freeze
19
+ VERSION = '4.2.0.alpha2'.freeze
20
20
  end
metadata CHANGED
@@ -1,97 +1,97 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ovirt-engine-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.0.alpha1
4
+ version: 4.2.0.alpha2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Hernandez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-06 00:00:00.000000000 Z
11
+ date: 2017-07-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: '11.3'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ~>
25
25
  - !ruby/object:Gem::Version
26
26
  version: '11.3'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake-compiler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ~>
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0.9'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ~>
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0.9'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ~>
46
46
  - !ruby/object:Gem::Version
47
47
  version: '3.3'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ~>
53
53
  - !ruby/object:Gem::Version
54
54
  version: '3.3'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rubocop
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ~>
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0.44'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ~>
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0.44'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: yard
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ~>
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0.8'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ~>
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0.8'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: json
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ">="
87
+ - - '>='
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ">="
94
+ - - '>='
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  description: Ruby SDK for the oVirt Engine API.
@@ -102,43 +102,43 @@ extensions:
102
102
  - ext/ovirtsdk4c/extconf.rb
103
103
  extra_rdoc_files: []
104
104
  files:
105
- - ".yardopts"
105
+ - .yardopts
106
106
  - CHANGES.adoc
107
107
  - LICENSE.txt
108
108
  - README.adoc
109
109
  - ext/ovirtsdk4c/extconf.rb
110
110
  - ext/ovirtsdk4c/ov_error.c
111
- - ext/ovirtsdk4c/ov_error.h
112
111
  - ext/ovirtsdk4c/ov_http_client.c
113
- - ext/ovirtsdk4c/ov_http_client.h
114
112
  - ext/ovirtsdk4c/ov_http_request.c
115
- - ext/ovirtsdk4c/ov_http_request.h
116
113
  - ext/ovirtsdk4c/ov_http_response.c
117
- - ext/ovirtsdk4c/ov_http_response.h
118
114
  - ext/ovirtsdk4c/ov_http_transfer.c
119
- - ext/ovirtsdk4c/ov_http_transfer.h
120
115
  - ext/ovirtsdk4c/ov_module.c
121
- - ext/ovirtsdk4c/ov_module.h
122
116
  - ext/ovirtsdk4c/ov_string.c
123
- - ext/ovirtsdk4c/ov_string.h
124
117
  - ext/ovirtsdk4c/ov_xml_reader.c
125
- - ext/ovirtsdk4c/ov_xml_reader.h
126
118
  - ext/ovirtsdk4c/ov_xml_writer.c
127
- - ext/ovirtsdk4c/ov_xml_writer.h
128
119
  - ext/ovirtsdk4c/ovirtsdk4c.c
120
+ - ext/ovirtsdk4c/ov_error.h
121
+ - ext/ovirtsdk4c/ov_http_client.h
122
+ - ext/ovirtsdk4c/ov_http_request.h
123
+ - ext/ovirtsdk4c/ov_http_response.h
124
+ - ext/ovirtsdk4c/ov_http_transfer.h
125
+ - ext/ovirtsdk4c/ov_module.h
126
+ - ext/ovirtsdk4c/ov_string.h
127
+ - ext/ovirtsdk4c/ov_xml_reader.h
128
+ - ext/ovirtsdk4c/ov_xml_writer.h
129
129
  - lib/ovirtsdk4.rb
130
130
  - lib/ovirtsdk4/connection.rb
131
131
  - lib/ovirtsdk4/error.rb
132
132
  - lib/ovirtsdk4/probe.rb
133
133
  - lib/ovirtsdk4/reader.rb
134
- - lib/ovirtsdk4/readers.rb
135
134
  - lib/ovirtsdk4/service.rb
136
- - lib/ovirtsdk4/services.rb
137
135
  - lib/ovirtsdk4/type.rb
138
- - lib/ovirtsdk4/types.rb
139
- - lib/ovirtsdk4/version.rb
140
136
  - lib/ovirtsdk4/writer.rb
137
+ - lib/ovirtsdk4/version.rb
138
+ - lib/ovirtsdk4/services.rb
139
+ - lib/ovirtsdk4/types.rb
141
140
  - lib/ovirtsdk4/writers.rb
141
+ - lib/ovirtsdk4/readers.rb
142
142
  homepage: http://ovirt.org
143
143
  licenses:
144
144
  - Apache-2.0
@@ -149,17 +149,17 @@ require_paths:
149
149
  - lib
150
150
  required_ruby_version: !ruby/object:Gem::Requirement
151
151
  requirements:
152
- - - ">="
152
+ - - '>='
153
153
  - !ruby/object:Gem::Version
154
154
  version: '2.0'
155
155
  required_rubygems_version: !ruby/object:Gem::Requirement
156
156
  requirements:
157
- - - ">"
157
+ - - '>'
158
158
  - !ruby/object:Gem::Version
159
159
  version: 1.3.1
160
160
  requirements: []
161
161
  rubyforge_project:
162
- rubygems_version: 2.5.1
162
+ rubygems_version: 2.0.14.1
163
163
  signing_key:
164
164
  specification_version: 4
165
165
  summary: oVirt SDK