opennebula 5.8.2 → 5.8.3

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: 137c7a56002185b6803c110c54da01dff7f53488
4
- data.tar.gz: 466c0810509f7475cb062963fb36b0c9f8ba25c3
3
+ metadata.gz: 59cb571959c796ba8b92646b4a8f9293fb19c252
4
+ data.tar.gz: 4b7f2bd7fa08c2fd3a36a4d9a534ab05c5d9b2d5
5
5
  SHA512:
6
- metadata.gz: 85b8f298341ac66239553304ac28ca793b1ad2664ca4d3edeb1b87c70fe6db0db6c759fbc58c3f7cf4049f01edbc40f192894fd5e62eb032075011831a2137ab
7
- data.tar.gz: 6e09c57a7594799c4ad76d4c333f9f0db21da2c779c9931e96e292be7d4db53d884de7fdffbc9f736157dcb48148d9d717df3f3ef964b15b7f0bed56919f0df0
6
+ metadata.gz: 8660cd399a412161a278cf77992d8a5a11c7720bad4770dcd197c2608e85177fc345fc6834186a6e33614e160069229d84417bc549990fea43c8c004563d2892
7
+ data.tar.gz: 2612e7931b904b7806f03e0524c98f5de766ae22b0487a4e6efdaf49fbef5d90299bebb77cab5d64b8d9932bd5d45bcefcd4ad879123915365342024ec9e1488
@@ -50,7 +50,7 @@ end
50
50
  module CloudClient
51
51
 
52
52
  # OpenNebula version
53
- VERSION = '5.8.2'
53
+ VERSION = '5.8.3'
54
54
 
55
55
  # #########################################################################
56
56
  # Default location for the authentication file
data/lib/opennebula.rb CHANGED
@@ -71,5 +71,5 @@ require 'opennebula/vntemplate_pool'
71
71
  module OpenNebula
72
72
 
73
73
  # OpenNebula version
74
- VERSION = '5.8.2'
74
+ VERSION = '5.8.3'
75
75
  end
@@ -39,6 +39,7 @@ class OpenNebula::LdapAuth
39
39
  :user => nil,
40
40
  :password => nil,
41
41
  :base => nil,
42
+ :group_base => nil,
42
43
  :auth_method => :simple,
43
44
  :user_field => 'cn',
44
45
  :user_group_field => 'dn',
@@ -198,9 +199,10 @@ class OpenNebula::LdapAuth
198
199
  end
199
200
  end
200
201
  else
202
+ group_base = @options[:group_base] ? @options[:group_base] : @options[:base]
201
203
  filter = Net::LDAP::Filter.equals(@options[:group_field], @user[@options[:user_group_field]].first)
202
204
  @ldap.search(
203
- :base => @options[:base],
205
+ :base => group_base,
204
206
  :attributes => [ "dn" ],
205
207
  :filter => filter
206
208
  ) do |entry|
@@ -233,10 +233,12 @@ module OpenNebula
233
233
 
234
234
  # Gets a hash from a info page from pool
235
235
  # size:: nil => default page size
236
- # > 0 => page size
236
+ # > 0 => page size
237
237
  # current first element of the page
238
+ # extended true to get extended information
239
+ # state state of the objects
238
240
  # hash:: return page as a hash
239
- def get_page(size, current, extended = false)
241
+ def get_page(size, current, extended = false, state = -1)
240
242
  rc = nil
241
243
 
242
244
  if PAGINATED_POOLS.include?(@pool_name)
@@ -249,19 +251,43 @@ module OpenNebula
249
251
  end
250
252
 
251
253
  size = OpenNebula.pool_page_size if (!size || size == 0)
252
- rc = @client.call(method, @user_id, current, -size, -1)
254
+ rc = @client.call(method, @user_id, current, -size, state)
253
255
 
254
256
  initialize_xml(rc, @pool_name)
255
257
  else
256
258
  rc = info
257
259
  end
258
260
 
259
- return rc
261
+ return rc
262
+ end
263
+
264
+ # Iterates over pool pages
265
+ # size:: nil => default page size
266
+ # > 0 => page size
267
+ # state state of objects
268
+ # delete true to take always the first page
269
+ def each_page(size, state = -1, extended = false, delete = false)
270
+ current = 0
271
+ element = @pool_name.split('_')[0]
272
+ page = OpenNebula::XMLElement.new
273
+
274
+ loop do
275
+ page.initialize_xml(get_page(size, current, extended, state),
276
+ @pool_name)
277
+
278
+ break if page["//#{element}"].nil?
279
+
280
+ page.each("//#{element}") do |obj|
281
+ yield(obj)
282
+ end
283
+
284
+ current += size unless delete
285
+ end
260
286
  end
261
287
 
262
288
  # Return true if pool is paginated
263
289
  def is_paginated?
264
- PAGINATED_POOLS.include?(@pool_name)
290
+ PAGINATED_POOLS.include?(@pool_name)
265
291
  end
266
292
  end
267
293
  end
@@ -44,7 +44,9 @@ class VCenterConf < Hash
44
44
  DEFAULT_CONFIGURATION = {
45
45
  :delete_images => false,
46
46
  :vm_poweron_wait_default => 300,
47
- :debug_information => false
47
+ :debug_information => false,
48
+ :retries => 3,
49
+ :retry_interval => 1
48
50
  }
49
51
 
50
52
  def initialize
@@ -83,6 +85,13 @@ require 'vm_template'
83
85
  require 'virtual_machine'
84
86
  require 'network'
85
87
  require 'file_helper'
88
+ require 'vm_folder'
89
+ require 'vmm_importer'
90
+ require 'vm_device'
91
+ require 'vm_disk'
92
+ require 'vm_nic'
93
+ require 'vm_helper'
94
+ require 'vm_monitor'
86
95
 
87
96
  CHECK_REFS = true
88
97
 
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.8.2
4
+ version: 5.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenNebula
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-13 00:00:00.000000000 Z
11
+ date: 2019-06-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri