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 +4 -4
- data/lib/cloud/CloudClient.rb +1 -1
- data/lib/models/service.rb +24 -15
- data/lib/opennebula/flow/service_template.rb +11 -3
- data/lib/opennebula/pool.rb +7 -5
- data/lib/opennebula.rb +1 -1
- data/lib/vm_template.rb +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2297734850551fc2c89b8d6bbccd43408724e330
|
4
|
+
data.tar.gz: e7bc524512feaa2dd9215214aa2b273dd6a9f8d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6df4eefbb624baa5f43f4959d188f43ef1ad36cb25814f76b829480bd26b60946489029d0623727d96881eff87efe9755a823884a7988fe68206d43fe86442af
|
7
|
+
data.tar.gz: 547a06b4424a0f2dfaeec1a2c4c9ac4a5fa8854665338fe34e7ebc9b6cbd0de3682c6ade82b9360fb7e68a9c9bbb2d4fb3a89c05757652e8e98c732951e52447
|
data/lib/cloud/CloudClient.rb
CHANGED
data/lib/models/service.rb
CHANGED
@@ -522,31 +522,40 @@ module OpenNebula
|
|
522
522
|
|
523
523
|
# Check that changes values are correct
|
524
524
|
#
|
525
|
-
# @param template_json [String]
|
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
|
533
|
-
|
534
|
-
|
533
|
+
if append
|
534
|
+
IMMUTABLE_ATTRS.each do |attr|
|
535
|
+
next if template[attr].nil?
|
535
536
|
|
536
|
-
|
537
|
-
|
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
|
-
|
540
|
-
|
544
|
+
IMMUTABLE_ATTRS.each do |attr|
|
545
|
+
next if template[attr] == @body[attr]
|
541
546
|
|
542
|
-
|
543
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
311
|
-
|
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
|
-
|
320
|
+
return [false, "service_template/#{attr}"]
|
321
|
+
end
|
314
322
|
end
|
315
323
|
|
316
324
|
template = @body.merge(template) if append
|
data/lib/opennebula/pool.rb
CHANGED
@@ -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
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
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
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.
|
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-
|
11
|
+
date: 2021-10-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|