opennebula 5.10.1 → 5.10.2

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: 8a19ccbf7c75994d0df9d81d00cfb1928d1aaad4
4
- data.tar.gz: 8f83b568d0c7957186616d944d066c03c56e1b89
3
+ metadata.gz: 227d8b4be52afd391e76b2401c00f4a129389f76
4
+ data.tar.gz: b3c5dbcc764c1dbc05367e0289034f65a0bc59a0
5
5
  SHA512:
6
- metadata.gz: 6c7f635b9e8610dc6a885d029bf95528462e87461dbbeb8f9f92ee60185d5be774a0ad80a6167c1177e252c9069fbdca7ab9ed1bd297c134a123c85fd1b68ac4
7
- data.tar.gz: 305925de087cdaee012d6269e930b894ce755604a81d2d193350b184de17db77e251078233011bac5e0faf5e7f2f7ca1ad91c433818ce4bf9e7cd4d7a7dcb1b8
6
+ metadata.gz: 3c344017ee0270ccb63cf0fc1f1c074730c3761311218bb27fd5075888be7cd012858ad517b88c3f7e427a92b857df91d9dd1c08e9fc2d62989e1594bba498a1
7
+ data.tar.gz: 92229d0d5d414d295a85a8cbed31d70afd2a3d48d90a8f90813e474a959a791265da519d3a68bf16c7cf9f8d244519fb9208e4beb4547c51afdb0f115e069c2b
@@ -51,7 +51,7 @@ end
51
51
  module CloudClient
52
52
 
53
53
  # OpenNebula version
54
- VERSION = '5.10.1'
54
+ VERSION = '5.10.2'
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.10.1'
77
+ VERSION = '5.10.2'
78
78
  end
@@ -261,27 +261,52 @@ module OpenNebula
261
261
  return rc
262
262
  end
263
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)
264
+ # Iterates over pool page
265
+ def loop_page(size, state, extended)
270
266
  current = 0
271
267
  element = @pool_name.split('_')[0]
272
268
  page = OpenNebula::XMLElement.new
273
269
 
274
270
  loop do
275
- page.initialize_xml(get_page(size, current, extended, state),
271
+ page.initialize_xml(get_page(size,
272
+ current,
273
+ extended,
274
+ state),
276
275
  @pool_name)
277
276
 
278
277
  break if page["//#{element}"].nil?
279
278
 
279
+ current += yield(element, page)
280
+ end
281
+ end
282
+
283
+ # Iterates over pool pages
284
+ # size:: nil => default page size
285
+ # > 0 => page size
286
+ # state state of objects
287
+ def each_page(size, state = -1, extended = false)
288
+ loop_page(size, state, extended) do |element, page|
280
289
  page.each("//#{element}") do |obj|
281
290
  yield(obj)
282
291
  end
283
292
 
284
- current += size unless delete
293
+ size
294
+ end
295
+ end
296
+
297
+ # Iterates over pool pages to delete them
298
+ # size:: nil => default page size
299
+ # > 0 => page size
300
+ # state state of objects
301
+ def each_page_delete(size, state = -1, extended = false)
302
+ loop_page(size, state, extended) do |element, page|
303
+ no_deleted = 0
304
+
305
+ page.each("//#{element}") do |obj|
306
+ no_deleted += 1 if !yield(obj)
307
+ end
308
+
309
+ no_deleted
285
310
  end
286
311
  end
287
312
 
@@ -50,6 +50,13 @@ module OpenNebula
50
50
  @user_id = user_id
51
51
  end
52
52
 
53
+ # Get info extended VM
54
+ def get_hash_extended
55
+ rc = info_search(:extended => true)
56
+ return rc if OpenNebula.is_error?(rc)
57
+ to_hash
58
+ end
59
+
53
60
  # Default Factory Method for the Pools
54
61
  def factory(element_xml)
55
62
  OpenNebula::VirtualMachine.new(element_xml,@client)
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.10.1
4
+ version: 5.10.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenNebula
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-10 00:00:00.000000000 Z
11
+ date: 2020-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri