opennebula 6.1.80.pre → 6.1.90.pre

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: 3ec17a7a8b4c347550f293bb4db7f82cee1f1daf
4
- data.tar.gz: 55f73a012fe7fae60070f37afca0cfab81fad686
3
+ metadata.gz: 2297734850551fc2c89b8d6bbccd43408724e330
4
+ data.tar.gz: e7bc524512feaa2dd9215214aa2b273dd6a9f8d5
5
5
  SHA512:
6
- metadata.gz: 504d1fd56b5b115bf6d6f49b689791eaf238ef75be357dd1debac901e2495fccc43d9cabc9c174e25d307768454254468201643975ee1920f7aafa98d2e26109
7
- data.tar.gz: 2b295c38fd943e500cb78890462a0e98f34289646422ce5092080b03ea694d99bd2d0240e6bb0a706854daa9848acb42702bb47a2c4d0156b895f5038e007015
6
+ metadata.gz: 6df4eefbb624baa5f43f4959d188f43ef1ad36cb25814f76b829480bd26b60946489029d0623727d96881eff87efe9755a823884a7988fe68206d43fe86442af
7
+ data.tar.gz: 547a06b4424a0f2dfaeec1a2c4c9ac4a5fa8854665338fe34e7ebc9b6cbd0de3682c6ade82b9360fb7e68a9c9bbb2d4fb3a89c05757652e8e98c732951e52447
@@ -51,7 +51,7 @@ end
51
51
  module CloudClient
52
52
 
53
53
  # OpenNebula version
54
- VERSION = '6.1.80'
54
+ VERSION = '6.1.90'
55
55
 
56
56
  # #########################################################################
57
57
  # Default location for the authentication file
@@ -522,31 +522,40 @@ module OpenNebula
522
522
 
523
523
  # Check that changes values are correct
524
524
  #
525
- # @param template_json [String] New template
525
+ # @param template_json [String] New template
526
+ # @param append [Boolean] True to append template to the current
526
527
  #
527
528
  # @return [Boolean, String] True, nil if everything is correct
528
529
  # False, attr if attr was changed
529
- def check_new_template(template_json)
530
+ def check_new_template(template_json, append)
530
531
  template = JSON.parse(template_json)
531
532
 
532
- if template['roles'].size != @roles.size
533
- return [false, 'service/roles size']
534
- end
533
+ if append
534
+ IMMUTABLE_ATTRS.each do |attr|
535
+ next if template[attr].nil?
535
536
 
536
- IMMUTABLE_ATTRS.each do |attr|
537
- next if template[attr] == @body[attr]
537
+ return [false, "service/#{attr}"]
538
+ end
539
+ else
540
+ if template['roles'].size != @roles.size
541
+ return [false, 'service/roles size']
542
+ end
538
543
 
539
- return [false, "service/#{attr}"]
540
- end
544
+ IMMUTABLE_ATTRS.each do |attr|
545
+ next if template[attr] == @body[attr]
541
546
 
542
- template['roles'].each do |role|
543
- # Role name can't be changed, if it is changed some problems
544
- # may appear, as name is used to reference roles
545
- return [false, 'name'] unless @roles[role['name']]
547
+ return [false, "service/#{attr}"]
548
+ end
546
549
 
547
- rc = @roles[role['name']].check_new_template(role)
550
+ template['roles'].each do |role|
551
+ # Role name can't be changed, if it is changed some problems
552
+ # may appear, as name is used to reference roles
553
+ return [false, 'name'] unless @roles[role['name']]
548
554
 
549
- return rc unless rc[0]
555
+ rc = @roles[role['name']].check_new_template(role)
556
+
557
+ return rc unless rc[0]
558
+ end
550
559
  end
551
560
 
552
561
  [true, nil]
@@ -307,10 +307,18 @@ module OpenNebula
307
307
 
308
308
  template = JSON.parse(template_json)
309
309
 
310
- IMMUTABLE_ATTRS.each do |attr|
311
- next if template[attr] == @body[attr]
310
+ if append
311
+ IMMUTABLE_ATTRS.each do |attr|
312
+ unless template[attr].nil?
313
+ return [false, "service_template/#{attr}"]
314
+ end
315
+ end
316
+ else
317
+ IMMUTABLE_ATTRS.each do |attr|
318
+ next if template[attr] == @body[attr]
312
319
 
313
- return [false, "service_template/#{attr}"]
320
+ return [false, "service_template/#{attr}"]
321
+ end
314
322
  end
315
323
 
316
324
  template = @body.merge(template) if append
@@ -261,6 +261,8 @@ module OpenNebula
261
261
  size = OpenNebula.pool_page_size if (!size || size == 0)
262
262
  rc = @client.call(method, @user_id, current, -size, state)
263
263
 
264
+ return rc if OpenNebula.is_error?(rc)
265
+
264
266
  initialize_xml(rc, @pool_name)
265
267
  else
266
268
  rc = info
@@ -276,11 +278,11 @@ module OpenNebula
276
278
  page = OpenNebula::XMLElement.new
277
279
 
278
280
  loop do
279
- page.initialize_xml(get_page(size,
280
- current,
281
- extended,
282
- state),
283
- @pool_name)
281
+ rc = get_page(size, current, extended, state)
282
+
283
+ break rc if OpenNebula.is_error?(rc)
284
+
285
+ page.initialize_xml(rc, @pool_name)
284
286
 
285
287
  break if page["//#{element}"].nil?
286
288
 
data/lib/opennebula.rb CHANGED
@@ -77,5 +77,5 @@ require 'opennebula/flow'
77
77
  module OpenNebula
78
78
 
79
79
  # OpenNebula version
80
- VERSION = '6.1.80'
80
+ VERSION = '6.1.90'
81
81
  end
data/lib/vm_template.rb CHANGED
@@ -40,7 +40,7 @@ module VCenterDriver
40
40
  def lock
41
41
  return unless @locking
42
42
 
43
- @locking_file = File.open('/tmp/vcenter-importer-lock', 'w')
43
+ @locking_file = File.open('/var/tmp/vcenter-importer-lock', 'w')
44
44
  @locking_file.flock(File::LOCK_EX)
45
45
  end
46
46
 
@@ -50,9 +50,9 @@ module VCenterDriver
50
50
 
51
51
  @locking_file.close
52
52
 
53
- return unless File.exist?('/tmp/vcenter-importer-lock')
53
+ return unless File.exist?('/var/tmp/vcenter-importer-lock')
54
54
 
55
- File.delete('/tmp/vcenter-importer-lock')
55
+ File.delete('/var/tmp/vcenter-importer-lock')
56
56
  end
57
57
 
58
58
  def vm?
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: 6.1.80.pre
4
+ version: 6.1.90.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenNebula
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-05 00:00:00.000000000 Z
11
+ date: 2021-10-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri