opennebula 5.12.0 → 5.12.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cloud/CloudClient.rb +1 -1
- data/lib/opennebula.rb +1 -1
- data/lib/opennebula/document_pool_json.rb +2 -2
- data/lib/opennebula/ldap_auth.rb +65 -0
- data/lib/vcenter_driver.rb +3 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 27c05d144109ae5a8e3995f035226e3cd5cf6adf
|
4
|
+
data.tar.gz: fa20b6ab2793fbce18a6e4f70cda6353edc61b95
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 425276a4cc8b3cc09132b444778dd4a1a58713d15aba34d30fd367819105b712bf50ebe5ba62c07156ef122173423c61481e647b164e08daef434fcc632b42b3
|
7
|
+
data.tar.gz: 9e1e231bf00191417afbcf6140ab6dc64f8180fe262076acfe632743df1fa13a1f9e8fa9a3fe80c1325ce135ecb2580be831bf1520a0c61cc1a9af60a106cdcf
|
data/lib/cloud/CloudClient.rb
CHANGED
data/lib/opennebula.rb
CHANGED
@@ -41,7 +41,7 @@ module OpenNebula
|
|
41
41
|
|
42
42
|
hash['DOCUMENT_POOL']['DOCUMENT'].each { |doc|
|
43
43
|
body = doc['TEMPLATE']["#{TEMPLATE_TAG}"]
|
44
|
-
if body
|
44
|
+
if body && !body.empty?
|
45
45
|
b_hash = JSON.parse(body)
|
46
46
|
doc['TEMPLATE']["#{TEMPLATE_TAG}"] = b_hash
|
47
47
|
end
|
@@ -55,4 +55,4 @@ module OpenNebula
|
|
55
55
|
end
|
56
56
|
end
|
57
57
|
end
|
58
|
-
end
|
58
|
+
end
|
data/lib/opennebula/ldap_auth.rb
CHANGED
@@ -222,3 +222,68 @@ class OpenNebula::LdapAuth
|
|
222
222
|
groups.compact.uniq
|
223
223
|
end
|
224
224
|
end
|
225
|
+
|
226
|
+
|
227
|
+
# ---------------------------------------------------------------------------- #
|
228
|
+
# Helper functions to parse ldap_auth.conf server entries
|
229
|
+
# ---------------------------------------------------------------------------- #
|
230
|
+
def to_array(name)
|
231
|
+
if name.is_a? Array
|
232
|
+
name
|
233
|
+
elsif name.is_a? Hash
|
234
|
+
if name.keys.size == 1
|
235
|
+
[name.values].flatten
|
236
|
+
else
|
237
|
+
STDERR.puts "invalid group configuration: #{name}"
|
238
|
+
exit(-1)
|
239
|
+
end
|
240
|
+
else
|
241
|
+
[name]
|
242
|
+
end
|
243
|
+
end
|
244
|
+
|
245
|
+
def get_server_order(opts, user)
|
246
|
+
order = []
|
247
|
+
|
248
|
+
if opts[:order] && opts[:match_user_regex]
|
249
|
+
STDERR.puts ":order and :match_user_regex are mutually exclusive"
|
250
|
+
exit(-1)
|
251
|
+
end
|
252
|
+
|
253
|
+
if opts[:order]
|
254
|
+
if opts[:order].class != Array
|
255
|
+
STDERR.puts ":order value malformed, must be an Array"
|
256
|
+
exit(-1)
|
257
|
+
end
|
258
|
+
|
259
|
+
opts[:order].each do |name|
|
260
|
+
order << to_array(name)
|
261
|
+
end
|
262
|
+
|
263
|
+
elsif opts[:match_user_regex]
|
264
|
+
if opts[:match_user_regex].class != Hash || opts[:match_user_regex].empty?
|
265
|
+
STDERR.puts ":match_user_regex value malformed, must be an Hash"
|
266
|
+
exit(-1)
|
267
|
+
end
|
268
|
+
|
269
|
+
opts[:match_user_regex].each do |regex, server|
|
270
|
+
if m = user.match(/#{regex}/i)
|
271
|
+
|
272
|
+
# update user with the capture
|
273
|
+
user = m[1] if m[1]
|
274
|
+
|
275
|
+
order << to_array(server)
|
276
|
+
end
|
277
|
+
end
|
278
|
+
|
279
|
+
if order.empty?
|
280
|
+
STDERR.puts "User #{user} does not mach any regex"
|
281
|
+
end
|
282
|
+
|
283
|
+
else
|
284
|
+
STDERR.puts "missing either :order or :match_user_regex in configuration"
|
285
|
+
exit(-1)
|
286
|
+
end
|
287
|
+
|
288
|
+
return [order, user]
|
289
|
+
end
|
data/lib/vcenter_driver.rb
CHANGED
@@ -37,8 +37,9 @@ end
|
|
37
37
|
ENV['LANG'] = 'C'
|
38
38
|
|
39
39
|
if File.directory?(GEMS_LOCATION)
|
40
|
-
|
41
|
-
|
40
|
+
$LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
|
41
|
+
require 'rubygems'
|
42
|
+
Gem.use_paths(File.realpath(GEMS_LOCATION))
|
42
43
|
end
|
43
44
|
|
44
45
|
$LOAD_PATH << LIB_LOCATION + '/ruby/vendors/rbvmomi/lib'
|
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: 5.12.
|
4
|
+
version: 5.12.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- OpenNebula
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|