opennebula 5.11.90.pre → 5.12.0.4

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: 66f5101f43db2d5926a91cf47d329b3195267d3c
4
- data.tar.gz: 57d61ad0c4d687eadeb7521dc9e7a68c6214ec38
3
+ metadata.gz: 63d746c40cae457796346c6815881dfc3f7f69d7
4
+ data.tar.gz: 2351ef174d044ff75844a5abb074ec40fdeaf1fc
5
5
  SHA512:
6
- metadata.gz: f3c263ed781184aad101a456e83909bb0c6c149e3b0e931d4560772bbae13e9888cd4e866e886548eccff3b89b8067e0ec2882052ff930e94da88e4d2c00d657
7
- data.tar.gz: f79a5e7d90929e2a1fef95e615971d41a82d558597ccac349be2fb7c8ae81b2bcae46ceee57eb5059987ab993fed492887ecec772606d23243a37e81411a7665
6
+ metadata.gz: 626825395aceb4b95018653d1935b5317fd464f79e041317c70cd4269ed31a0e3a50831c426d6782e73f43b751ea92a5c74c6f59834943b87c6c95fa874c4ad2
7
+ data.tar.gz: bc6990eeddf1efc9ccf5f69ad95786a07ea14f6cc69cb5cb4f9feeb1eff4a14c065853e43c41914d5080f6449ec2702a913074010b100f6cf60ba6a37ee7e168
@@ -179,13 +179,23 @@ private
179
179
  i.write stdin_data
180
180
  i.close
181
181
 
182
- out = [out_reader.value, err_reader.value, t.value]
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
- out
197
+ # return values
198
+ [out_reader.value, err_reader.value, t.value]
189
199
  }
190
200
  end
191
201
 
@@ -51,7 +51,7 @@ end
51
51
  module CloudClient
52
52
 
53
53
  # OpenNebula version
54
- VERSION = '5.11.90'
54
+ VERSION = '5.12.0.4'
55
55
 
56
56
  # #########################################################################
57
57
  # Default location for the authentication file
data/lib/opennebula.rb CHANGED
@@ -74,5 +74,5 @@ require 'opennebula/hook_log'
74
74
  module OpenNebula
75
75
 
76
76
  # OpenNebula version
77
- VERSION = '5.11.90'
77
+ VERSION = '5.12.0.4'
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
@@ -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 -1
145
+ exit(-1)
138
146
  end
139
147
 
140
148
  vm_pool.each do |vm|
@@ -99,8 +99,8 @@ 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 number of monitoring records to be
103
- # retrieved. If nill all records are retrieved
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
104
  #
105
105
  # @return [String] VM monitoring data, in XML
106
106
  def monitoring_xml(num = nil)
@@ -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
@@ -23,14 +23,14 @@ module OpenNebula
23
23
  # Constants and Class attribute accessors
24
24
  #######################################################################
25
25
 
26
-
27
26
  VM_POOL_METHODS = {
28
- :info => "vmpool.info",
29
- :info_extended => "vmpool.infoextended",
30
- :monitoring => "vmpool.monitoring",
31
- :accounting => "vmpool.accounting",
32
- :showback => "vmpool.showback",
33
- :calculate_showback => "vmpool.calculateshowback"
27
+ :info => 'vmpool.info',
28
+ :info_extended => 'vmpool.infoextended',
29
+ :info_set => 'vmpool.infoset',
30
+ :monitoring => 'vmpool.monitoring',
31
+ :accounting => 'vmpool.accounting',
32
+ :showback => 'vmpool.showback',
33
+ :calculate_showback => 'vmpool.calculateshowback'
34
34
  }
35
35
 
36
36
  # Constants for info queries (include/RequestManagerPoolInfoFilter.h)
@@ -41,7 +41,6 @@ module OpenNebula
41
41
  # Class constructor & Pool Methods
42
42
  #######################################################################
43
43
 
44
-
45
44
  # +client+ a Client object that represents a XML-RPC connection
46
45
  # +user_id+ is to refer to a Pool with VirtualMachines from that user
47
46
  def initialize(client, user_id=0)
@@ -102,21 +101,21 @@ module OpenNebula
102
101
  end
103
102
 
104
103
  # Define info methods shortcuts for different filters
105
- # info_all()
104
+ # info_all()
106
105
  # info_all!()
107
- # info_all_extended
106
+ # info_all_extended
108
107
  # info_all_extended!()
109
- # info_mine()
108
+ # info_mine()
110
109
  # info_mine!()
111
- # info_mine_extended
110
+ # info_mine_extended
112
111
  # info_mine_extended!()
113
- # info_group()
112
+ # info_group()
114
113
  # info_group!()
115
- # info_group_extended
114
+ # info_group_extended
116
115
  # info_group_extended!()
117
- # info_primary_group()
116
+ # info_primary_group()
118
117
  # info_primary_group!()
119
- # info_primary_group_extended
118
+ # info_primary_group_extended
120
119
  # info_primary_group_extended!()
121
120
  %w[mine all group primary_group].each do |ifilter|
122
121
  const_name = "OpenNebula::Pool::INFO_#{ifilter.upcase}"
@@ -160,6 +159,14 @@ module OpenNebula
160
159
  default_args[:query])
161
160
  end
162
161
 
162
+ # Retrieves the set of VMs especified in vm_ids
163
+ #
164
+ # @param [String] comma separated list of vm ids.
165
+ # @param [Boolean] if true extended body is retrieved.
166
+ #
167
+ def info_set(vm_ids, extended)
168
+ xmlrpc_info(VM_POOL_METHODS[:info_set], vm_ids, extended)
169
+ end
163
170
 
164
171
  # Retrieves the monitoring data for all the VMs in the pool
165
172
  #
@@ -199,8 +206,8 @@ module OpenNebula
199
206
  #
200
207
  # @param [Integer] filter_flag Optional filter flag to retrieve all or
201
208
  # part of the Pool. Possible values: INFO_ALL, INFO_GROUP, INFO_MINE.
202
- # @param [Integer] num Optional number of monitoring records to be
203
- # retrieved. If nill all records are retrieved
209
+ # @param [Integer] num Optional Retrieve monitor records in the last num
210
+ # seconds. 0 just the last record, -1 or nil all records
204
211
  # @return [String] VM monitoring data, in XML
205
212
  def monitoring_xml(filter_flag=INFO_ALL, num=nil)
206
213
  return @client.call(VM_POOL_METHODS[:monitoring], filter_flag) if num.nil?
@@ -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'
@@ -57,6 +58,7 @@ class VCenterConf < Hash
57
58
  }
58
59
 
59
60
  def initialize
61
+ super
60
62
  replace(DEFAULT_CONFIGURATION)
61
63
  begin
62
64
  vcenterrc_path = "#{VAR_LOCATION}/remotes/etc/vmm/vcenter/vcenterrc"
@@ -81,7 +83,7 @@ require 'resolv'
81
83
  # vCenter Library #
82
84
  # ---------------------------------------------------------------------------- #
83
85
 
84
- require 'vcenter_importer.rb'
86
+ require 'vcenter_importer'
85
87
  require 'memoize'
86
88
  require 'vi_client'
87
89
  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.11.90.pre
4
+ version: 5.12.0.4
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-01 00:00:00.000000000 Z
11
+ date: 2021-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -65,6 +65,30 @@ files:
65
65
  - lib/CommandManager.rb
66
66
  - lib/ActionManager.rb
67
67
  - lib/DriverExecHelper.rb
68
+ - lib/opennebula/security_group_pool.rb
69
+ - lib/opennebula/system.rb
70
+ - lib/opennebula/template.rb
71
+ - lib/opennebula/template_pool.rb
72
+ - lib/opennebula/user.rb
73
+ - lib/opennebula/user_pool.rb
74
+ - lib/opennebula/utils.rb
75
+ - lib/opennebula/vdc.rb
76
+ - lib/opennebula/vdc_pool.rb
77
+ - lib/opennebula/virtual_machine.rb
78
+ - lib/opennebula/virtual_machine_pool.rb
79
+ - lib/opennebula/virtual_network.rb
80
+ - lib/opennebula/virtual_network_pool.rb
81
+ - lib/opennebula/virtual_router.rb
82
+ - lib/opennebula/virtual_router_pool.rb
83
+ - lib/opennebula/vm_group.rb
84
+ - lib/opennebula/vm_group_pool.rb
85
+ - lib/opennebula/vntemplate.rb
86
+ - lib/opennebula/vntemplate_pool.rb
87
+ - lib/opennebula/xml_element.rb
88
+ - lib/opennebula/xml_pool.rb
89
+ - lib/opennebula/xml_utils.rb
90
+ - lib/opennebula/zone.rb
91
+ - lib/opennebula/zone_pool.rb
68
92
  - lib/opennebula/acl.rb
69
93
  - lib/opennebula/acl_pool.rb
70
94
  - lib/opennebula/client.rb
@@ -94,32 +118,8 @@ files:
94
118
  - lib/opennebula/pool.rb
95
119
  - lib/opennebula/pool_element.rb
96
120
  - lib/opennebula/security_group.rb
97
- - lib/opennebula/security_group_pool.rb
98
- - lib/opennebula/system.rb
99
- - lib/opennebula/template.rb
100
- - lib/opennebula/template_pool.rb
101
- - lib/opennebula/user.rb
102
- - lib/opennebula/user_pool.rb
103
- - lib/opennebula/utils.rb
104
- - lib/opennebula/vdc.rb
105
- - lib/opennebula/vdc_pool.rb
106
- - lib/opennebula/virtual_machine.rb
107
- - lib/opennebula/virtual_machine_pool.rb
108
- - lib/opennebula/virtual_network.rb
109
- - lib/opennebula/virtual_network_pool.rb
110
- - lib/opennebula/virtual_router.rb
111
- - lib/opennebula/virtual_router_pool.rb
112
- - lib/opennebula/vm_group.rb
113
- - lib/opennebula/vm_group_pool.rb
114
- - lib/opennebula/vntemplate.rb
115
- - lib/opennebula/vntemplate_pool.rb
116
- - lib/opennebula/xml_element.rb
117
- - lib/opennebula/xml_pool.rb
118
- - lib/opennebula/xml_utils.rb
119
- - lib/opennebula/zone.rb
120
- - lib/opennebula/zone_pool.rb
121
- - lib/opennebula/ldap_auth.rb
122
121
  - lib/opennebula/ldap_auth_spec.rb
122
+ - lib/opennebula/ldap_auth.rb
123
123
  - lib/opennebula/server_cipher_auth.rb
124
124
  - lib/opennebula/server_x509_auth.rb
125
125
  - lib/opennebula/ssh_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: 1.3.1
147
+ version: '0'
148
148
  requirements: []
149
149
  rubyforge_project:
150
150
  rubygems_version: 2.0.14.1