opennebula 5.11.85.pre → 5.12.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/CommandManager.rb +12 -2
- 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/host.rb +9 -1
- data/lib/opennebula/host_pool.rb +9 -2
- data/lib/opennebula/ldap_auth.rb +65 -0
- data/lib/opennebula/virtual_machine.rb +3 -1
- data/lib/opennebula/virtual_machine_pool.rb +6 -3
- data/lib/vcenter_driver.rb +4 -3
- 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: 65e92e0513a403d35a0ea71762bb6325a881f4de
|
4
|
+
data.tar.gz: b9fe2139bc5e82b5a0c6370dfc68ba35de0dabaa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fabb1d62d8d9c7e356cbbc237a5d2a8e0dc412ce0ec6a130fde7e9c07e30fe461c08325a2b5f7b3c566047a4d537d82732b7080f5378958929e2d53d6b64ddc3
|
7
|
+
data.tar.gz: 1b5bc228b4a57c247d528575279daebd653174003e4a9818e0a5b03248fef5fa26d9fd549ca6fead6188b345576023d59cfc314c370012a005c61fc543403bc6
|
data/lib/CommandManager.rb
CHANGED
@@ -179,13 +179,23 @@ private
|
|
179
179
|
i.write stdin_data
|
180
180
|
i.close
|
181
181
|
|
182
|
-
|
182
|
+
# blocking wait for process termination
|
183
|
+
t.value
|
184
|
+
|
185
|
+
# if reader threads are not dead yet, kill them
|
186
|
+
[out_reader, err_reader].each do |reader|
|
187
|
+
next unless reader.status
|
188
|
+
|
189
|
+
reader.join(0.1)
|
190
|
+
reader.kill
|
191
|
+
end
|
183
192
|
|
184
193
|
mutex.lock
|
185
194
|
terminator.kill
|
186
195
|
raise terminator_e if terminator_e
|
187
196
|
|
188
|
-
|
197
|
+
# return values
|
198
|
+
[out_reader.value, err_reader.value, t.value]
|
189
199
|
}
|
190
200
|
end
|
191
201
|
|
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/host.rb
CHANGED
@@ -125,6 +125,14 @@ module OpenNebula
|
|
125
125
|
set_status("OFFLINE")
|
126
126
|
end
|
127
127
|
|
128
|
+
#Resets monitoring forcing an update
|
129
|
+
def forceupdate()
|
130
|
+
rc = offline
|
131
|
+
return rc if OpenNebula.is_error?(rc)
|
132
|
+
|
133
|
+
enable
|
134
|
+
end
|
135
|
+
|
128
136
|
def flush(action)
|
129
137
|
self.disable
|
130
138
|
|
@@ -134,7 +142,7 @@ module OpenNebula
|
|
134
142
|
rc = vm_pool.info
|
135
143
|
if OpenNebula.is_error?(rc)
|
136
144
|
puts rc.message
|
137
|
-
exit
|
145
|
+
exit(-1)
|
138
146
|
end
|
139
147
|
|
140
148
|
vm_pool.each do |vm|
|
data/lib/opennebula/host_pool.rb
CHANGED
@@ -99,9 +99,16 @@ module OpenNebula
|
|
99
99
|
|
100
100
|
# Retrieves the monitoring data for all the Hosts in the pool, in XML
|
101
101
|
#
|
102
|
+
# @param [Integer] num Optional Retrieve monitor records in the last num
|
103
|
+
# seconds. 0 just the last record, -1 or nil all records
|
104
|
+
#
|
102
105
|
# @return [String] VM monitoring data, in XML
|
103
|
-
def monitoring_xml()
|
104
|
-
return @client.call(HOST_POOL_METHODS[:monitoring])
|
106
|
+
def monitoring_xml(num = nil)
|
107
|
+
return @client.call(HOST_POOL_METHODS[:monitoring]) if num.nil?
|
108
|
+
|
109
|
+
@client.call(HOST_POOL_METHODS[:monitoring], num.to_i)
|
105
110
|
end
|
111
|
+
|
106
112
|
end
|
113
|
+
|
107
114
|
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
|
@@ -122,6 +122,7 @@ module OpenNebula
|
|
122
122
|
DISK_RESIZE
|
123
123
|
DISK_RESIZE_POWEROFF
|
124
124
|
DISK_RESIZE_UNDEPLOYED
|
125
|
+
HOTPLUG_NIC_POWEROFF
|
125
126
|
}
|
126
127
|
|
127
128
|
SHORT_VM_STATES={
|
@@ -202,7 +203,8 @@ module OpenNebula
|
|
202
203
|
"PROLOG_MIGRATE_UNKNOWN_FAILURE" => "fail",
|
203
204
|
"DISK_RESIZE" => "drsz",
|
204
205
|
"DISK_RESIZE_POWEROFF" => "drsz",
|
205
|
-
"DISK_RESIZE_UNDEPLOYED" => "drsz"
|
206
|
+
"DISK_RESIZE_UNDEPLOYED" => "drsz",
|
207
|
+
"HOTPLUG_NIC_POWEROFF" => "hotp"
|
206
208
|
}
|
207
209
|
|
208
210
|
HISTORY_ACTION=%w{none migrate live-migrate shutdown shutdown-hard
|
@@ -199,10 +199,13 @@ module OpenNebula
|
|
199
199
|
#
|
200
200
|
# @param [Integer] filter_flag Optional filter flag to retrieve all or
|
201
201
|
# part of the Pool. Possible values: INFO_ALL, INFO_GROUP, INFO_MINE.
|
202
|
-
#
|
202
|
+
# @param [Integer] num Optional Retrieve monitor records in the last num
|
203
|
+
# seconds. 0 just the last record, -1 or nil all records
|
203
204
|
# @return [String] VM monitoring data, in XML
|
204
|
-
def monitoring_xml(filter_flag=INFO_ALL)
|
205
|
-
return @client.call(VM_POOL_METHODS[:monitoring], filter_flag)
|
205
|
+
def monitoring_xml(filter_flag=INFO_ALL, num=nil)
|
206
|
+
return @client.call(VM_POOL_METHODS[:monitoring], filter_flag) if num.nil?
|
207
|
+
|
208
|
+
@client.call(VM_POOL_METHODS[:monitoring], filter_flag, num.to_i)
|
206
209
|
end
|
207
210
|
|
208
211
|
# Processes all the history records, and stores the monthly cost for
|
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'
|
@@ -81,7 +82,7 @@ require 'resolv'
|
|
81
82
|
# vCenter Library #
|
82
83
|
# ---------------------------------------------------------------------------- #
|
83
84
|
|
84
|
-
require 'vcenter_importer
|
85
|
+
require 'vcenter_importer'
|
85
86
|
require 'memoize'
|
86
87
|
require 'vi_client'
|
87
88
|
begin
|
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.
|
4
|
+
version: 5.12.0.3
|
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-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -88,10 +88,8 @@ files:
|
|
88
88
|
- lib/opennebula/image_pool.rb
|
89
89
|
- lib/opennebula/marketplace.rb
|
90
90
|
- lib/opennebula/marketplace_pool.rb
|
91
|
-
- lib/opennebula/marketplaceapp.rb
|
92
91
|
- lib/opennebula/marketplaceapp_pool.rb
|
93
92
|
- lib/opennebula/oneflow_client.rb
|
94
|
-
- lib/opennebula/pool.rb
|
95
93
|
- lib/opennebula/pool_element.rb
|
96
94
|
- lib/opennebula/security_group.rb
|
97
95
|
- lib/opennebula/security_group_pool.rb
|
@@ -103,7 +101,6 @@ files:
|
|
103
101
|
- lib/opennebula/utils.rb
|
104
102
|
- lib/opennebula/vdc.rb
|
105
103
|
- lib/opennebula/vdc_pool.rb
|
106
|
-
- lib/opennebula/virtual_machine.rb
|
107
104
|
- lib/opennebula/virtual_machine_pool.rb
|
108
105
|
- lib/opennebula/virtual_network.rb
|
109
106
|
- lib/opennebula/virtual_network_pool.rb
|
@@ -118,6 +115,9 @@ files:
|
|
118
115
|
- lib/opennebula/xml_utils.rb
|
119
116
|
- lib/opennebula/zone.rb
|
120
117
|
- lib/opennebula/zone_pool.rb
|
118
|
+
- lib/opennebula/marketplaceapp.rb
|
119
|
+
- lib/opennebula/pool.rb
|
120
|
+
- lib/opennebula/virtual_machine.rb
|
121
121
|
- lib/opennebula/ldap_auth.rb
|
122
122
|
- lib/opennebula/ldap_auth_spec.rb
|
123
123
|
- lib/opennebula/server_cipher_auth.rb
|
@@ -142,9 +142,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
142
142
|
version: '0'
|
143
143
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
144
144
|
requirements:
|
145
|
-
- - '
|
145
|
+
- - '>='
|
146
146
|
- !ruby/object:Gem::Version
|
147
|
-
version:
|
147
|
+
version: '0'
|
148
148
|
requirements: []
|
149
149
|
rubyforge_project:
|
150
150
|
rubygems_version: 2.0.14.1
|