opennebula 4.9.80.beta → 4.10.0

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: 42545275d236ad905c7717b1927435e9a488a90f
4
- data.tar.gz: 816f67281352c3d865624c23192837ebb5f37fa6
3
+ metadata.gz: 82ab43ef0a7087ed43b6c4d8ffe865a2a2ceacbd
4
+ data.tar.gz: 78dba1712d3497bc69c477d9148d30682267f408
5
5
  SHA512:
6
- metadata.gz: c4ae1c7e5d8165a72102eb2aaca7c483b7cf14b5fba21a7397c8fe0ccf429b492b729e259bdf33aa4087b7f9a7f08a2ff0dbbbbabd8a8c63996f47a45e3a5491
7
- data.tar.gz: ba6fecc6ab0d1aa568196d10e23a6c4e8ef9940f62934ebb77405c44eeed2093b5d7ce9204cacbd4ae9d0d7539a5a7b8542460ed9d7bfd19cefe5d407da1557f
6
+ metadata.gz: d577db87ccac6fbbfe545d812599feaf9dee940f1881085640b9cbbab211095cf52762a554cd3d27640dc8bfb31632f5ed2f21a32fbb1da0154c0f8698882fed
7
+ data.tar.gz: 5a4e4f547a0c25213ac3d0af35d4aa6ab3540b71e0ac37f3ca5879c79ccff99771f657fddbad6425f1e745990e26683c1989edded4215385eac371bc82402f93
@@ -56,5 +56,5 @@ require 'opennebula/system'
56
56
  module OpenNebula
57
57
 
58
58
  # OpenNebula version
59
- VERSION = '4.9.80'
59
+ VERSION = '4.10.0'
60
60
  end
@@ -17,6 +17,7 @@
17
17
  require 'xmlrpc/client'
18
18
  require 'bigdecimal'
19
19
  require 'stringio'
20
+ require 'openssl'
20
21
 
21
22
 
22
23
  module OpenNebula
@@ -105,6 +106,14 @@ module OpenNebula
105
106
  # defaults to 30
106
107
  # @option params [String] :http_proxy HTTP proxy string used for
107
108
  # connecting to the endpoint; defaults to no proxy
109
+ # @option params [Boolean] :sync Use only one http connection for
110
+ # all calls. It should not be used for multithreaded programs.
111
+ # It's the only mode that can be used with :cert_dir and
112
+ # :disable_ssl_verify
113
+ # @option params [String] :cert_dir Extra directory where to import
114
+ # trusted issuer certificates. Use with :sync = true
115
+ # @option params [String] :disable_ssl_verify Disable SSL certificate
116
+ # verification. Use only for testing and with :sync = true
108
117
  #
109
118
  # @return [OpenNebula::Client]
110
119
  def initialize(secret=nil, endpoint=nil, options={})
@@ -135,6 +144,8 @@ module OpenNebula
135
144
  @one_endpoint = "http://localhost:2633/RPC2"
136
145
  end
137
146
 
147
+ @async = !options[:sync]
148
+
138
149
  timeout=nil
139
150
  timeout=options[:timeout] if options[:timeout]
140
151
 
@@ -144,6 +155,27 @@ module OpenNebula
144
155
  @server = XMLRPC::Client.new2(@one_endpoint, http_proxy, timeout)
145
156
  @server.http_header_extra = {'accept-encoding' => 'identity'}
146
157
 
158
+ http = @server.instance_variable_get("@http")
159
+
160
+ if options[:cert_dir] || ENV['ONE_CERT_DIR']
161
+ raise "SSL options don't work in async mode" if @async
162
+
163
+ cert_dir = options[:cert_dir] || ENV['ONE_CERT_DIR']
164
+ cert_files = Dir["#{cert_dir}/*"]
165
+
166
+ cert_store = OpenSSL::X509::Store.new
167
+ cert_store.set_default_paths
168
+ cert_files.each {|cert| cert_store.add_file(cert) }
169
+
170
+ http.cert_store = cert_store
171
+ end
172
+
173
+ if options[:disable_ssl_verify] || ENV['ONE_DISABLE_SSL_VERIFY']
174
+ raise "SSL options don't work in async mode" if @async
175
+
176
+ http.verify_mode = OpenSSL::SSL::VERIFY_NONE
177
+ end
178
+
147
179
  if defined?(OxStreamParser)
148
180
  @server.set_parser(OxStreamParser.new)
149
181
  elsif OpenNebula::NOKOGIRI
@@ -155,7 +187,11 @@ module OpenNebula
155
187
 
156
188
  def call(action, *args)
157
189
  begin
158
- response = @server.call_async("one."+action, @one_auth, *args)
190
+ if @async
191
+ response = @server.call_async("one."+action, @one_auth, *args)
192
+ else
193
+ response = @server.call("one."+action, @one_auth, *args)
194
+ end
159
195
 
160
196
  if response[0] == false
161
197
  Error.new(response[1], response[2])
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opennebula
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.9.80.beta
4
+ version: 4.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenNebula
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-14 00:00:00.000000000 Z
11
+ date: 2014-11-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -89,7 +89,8 @@ files:
89
89
  - lib/opennebula/zone.rb
90
90
  - lib/opennebula/zone_pool.rb
91
91
  homepage: http://opennebula.org
92
- licenses: []
92
+ licenses:
93
+ - Apache-2.0
93
94
  metadata: {}
94
95
  post_install_message:
95
96
  rdoc_options: []
@@ -102,9 +103,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
102
103
  version: '0'
103
104
  required_rubygems_version: !ruby/object:Gem::Requirement
104
105
  requirements:
105
- - - ">"
106
+ - - ">="
106
107
  - !ruby/object:Gem::Version
107
- version: 1.3.1
108
+ version: '0'
108
109
  requirements: []
109
110
  rubyforge_project:
110
111
  rubygems_version: 2.2.2