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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 56a4d4714f58633bd2aa93a39a0a0bf794782d64
4
- data.tar.gz: baf93114e6465fbca2a66a71d458638d9ff54061
3
+ metadata.gz: 27c05d144109ae5a8e3995f035226e3cd5cf6adf
4
+ data.tar.gz: fa20b6ab2793fbce18a6e4f70cda6353edc61b95
5
5
  SHA512:
6
- metadata.gz: cd7c9416854f0a4b6b9d9148ffe800dbee1f39706737aebc8c8692eb36041352704fca815aac338a1886478756fbaec08cc812f1511c3f7b3780de7b9a59be9e
7
- data.tar.gz: 3d12e853e46eac65b0f2023bb38158db72f9beedd704e842b31f9e0b19d96713a2e654146a6b37db4db8f3abae55e919437606343ef22280da977cc3bba48843
6
+ metadata.gz: 425276a4cc8b3cc09132b444778dd4a1a58713d15aba34d30fd367819105b712bf50ebe5ba62c07156ef122173423c61481e647b164e08daef434fcc632b42b3
7
+ data.tar.gz: 9e1e231bf00191417afbcf6140ab6dc64f8180fe262076acfe632743df1fa13a1f9e8fa9a3fe80c1325ce135ecb2580be831bf1520a0c61cc1a9af60a106cdcf
@@ -51,7 +51,7 @@ end
51
51
  module CloudClient
52
52
 
53
53
  # OpenNebula version
54
- VERSION = '5.12.0'
54
+ VERSION = '5.12.1'
55
55
 
56
56
  # #########################################################################
57
57
  # Default location for the authentication file
@@ -74,5 +74,5 @@ require 'opennebula/hook_log'
74
74
  module OpenNebula
75
75
 
76
76
  # OpenNebula version
77
- VERSION = '5.12.0'
77
+ VERSION = '5.12.1'
78
78
  end
@@ -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
@@ -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
@@ -37,8 +37,9 @@ end
37
37
  ENV['LANG'] = 'C'
38
38
 
39
39
  if File.directory?(GEMS_LOCATION)
40
- Gem.use_paths(GEMS_LOCATION)
41
- $LOAD_PATH.reject! {|l| l =~ /(vendor|site)_ruby/ }
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.0
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-06-14 00:00:00.000000000 Z
11
+ date: 2020-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri