opennebula 5.12.0.1 → 5.12.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/opennebula/document_pool_json.rb +2 -2
- data/lib/opennebula/ldap_auth.rb +65 -0
- data/lib/vcenter_driver.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b77dc0532f6cfb629081a6de695a1255d5d0afd
|
4
|
+
data.tar.gz: 7568d30195b4a031c263300279f3c98602bf3fe0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8fb01acb555f25d1e3e0578c321c054fcb83f7a6f25b841defa07ba633a6540547dac67f96c7270b271336164f2db04f2aac4104eb9eac018bd71ef47c50dc80
|
7
|
+
data.tar.gz: 265caa4291b12f82446d82d74aea931796451babba552bad80c3b8fe05e0d4a088a0080cf9ae7c7530927201dc4cce6dc1caf3004d848408dbece181dd986dd5
|
@@ -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
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.0.2
|
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-10-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -75,6 +75,7 @@ files:
|
|
75
75
|
- lib/opennebula/document.rb
|
76
76
|
- lib/opennebula/document_json.rb
|
77
77
|
- lib/opennebula/document_pool.rb
|
78
|
+
- lib/opennebula/document_pool_json.rb
|
78
79
|
- lib/opennebula/error.rb
|
79
80
|
- lib/opennebula/group.rb
|
80
81
|
- lib/opennebula/group_pool.rb
|
@@ -87,10 +88,8 @@ files:
|
|
87
88
|
- lib/opennebula/image_pool.rb
|
88
89
|
- lib/opennebula/marketplace.rb
|
89
90
|
- lib/opennebula/marketplace_pool.rb
|
90
|
-
- lib/opennebula/marketplaceapp.rb
|
91
91
|
- lib/opennebula/marketplaceapp_pool.rb
|
92
92
|
- lib/opennebula/oneflow_client.rb
|
93
|
-
- lib/opennebula/pool.rb
|
94
93
|
- lib/opennebula/pool_element.rb
|
95
94
|
- lib/opennebula/security_group.rb
|
96
95
|
- lib/opennebula/security_group_pool.rb
|
@@ -102,7 +101,6 @@ files:
|
|
102
101
|
- lib/opennebula/utils.rb
|
103
102
|
- lib/opennebula/vdc.rb
|
104
103
|
- lib/opennebula/vdc_pool.rb
|
105
|
-
- lib/opennebula/virtual_machine.rb
|
106
104
|
- lib/opennebula/virtual_machine_pool.rb
|
107
105
|
- lib/opennebula/virtual_network.rb
|
108
106
|
- lib/opennebula/virtual_network_pool.rb
|
@@ -117,9 +115,11 @@ files:
|
|
117
115
|
- lib/opennebula/xml_utils.rb
|
118
116
|
- lib/opennebula/zone.rb
|
119
117
|
- lib/opennebula/zone_pool.rb
|
120
|
-
- lib/opennebula/
|
121
|
-
- lib/opennebula/
|
118
|
+
- lib/opennebula/marketplaceapp.rb
|
119
|
+
- lib/opennebula/pool.rb
|
120
|
+
- lib/opennebula/virtual_machine.rb
|
122
121
|
- lib/opennebula/ldap_auth.rb
|
122
|
+
- lib/opennebula/ldap_auth_spec.rb
|
123
123
|
- lib/opennebula/server_cipher_auth.rb
|
124
124
|
- lib/opennebula/server_x509_auth.rb
|
125
125
|
- lib/opennebula/ssh_auth.rb
|