opennebula 6.0.0 → 6.0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/cloud/CloudClient.rb +1 -1
- data/lib/opennebula.rb +1 -1
- data/lib/opennebula/flow/service_template.rb +37 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6f9aa7355cf72de3df70da8d7fceb82907f97396
|
4
|
+
data.tar.gz: 749eef5d47ae22112fb3c8c1a1dc1d7f313ab5a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba3c4cfcf52af7756cdc67ccefb827e773bf60c5b38a2b8ba32e1dc232582edbb57e1e45994168052e0cc572f14b9d70c4504cb7ea82796122df5f6564609d56
|
7
|
+
data.tar.gz: 40ecec9f0e8f2cd10ea50241e97a0554eb6e14204feaf0780879990373415d5eaaceea254efb7cb09b112ffb464ebc7324a17fb980d6306edfef92816c29a745
|
data/lib/cloud/CloudClient.rb
CHANGED
data/lib/opennebula.rb
CHANGED
@@ -357,7 +357,15 @@ module OpenNebula
|
|
357
357
|
|
358
358
|
break rc if OpenNebula.is_error?(rc)
|
359
359
|
|
360
|
-
|
360
|
+
# The maximum size is 128, so crop the template name if it
|
361
|
+
# exceeds the limit
|
362
|
+
new_name = "#{template.name}-#{name}"
|
363
|
+
|
364
|
+
if new_name.size > 128
|
365
|
+
new_name = "#{template.name[0..(126 - name.size)]}-#{name}"
|
366
|
+
end
|
367
|
+
|
368
|
+
rc = template.clone(new_name, recursive)
|
361
369
|
|
362
370
|
break rc if OpenNebula.is_error?(rc)
|
363
371
|
|
@@ -384,6 +392,9 @@ module OpenNebula
|
|
384
392
|
return rc
|
385
393
|
end
|
386
394
|
|
395
|
+
# add registration time, as the template is new
|
396
|
+
body['registration_time'] = Integer(Time.now)
|
397
|
+
|
387
398
|
# update the template with the new body
|
388
399
|
doc.update(body.to_json)
|
389
400
|
|
@@ -391,6 +402,31 @@ module OpenNebula
|
|
391
402
|
new_id
|
392
403
|
end
|
393
404
|
|
405
|
+
# Clones a service template
|
406
|
+
#
|
407
|
+
# @param name [Stirng] New name
|
408
|
+
#
|
409
|
+
# @return [Integer] New template ID
|
410
|
+
def clone(name)
|
411
|
+
new_id = super
|
412
|
+
|
413
|
+
doc = OpenNebula::ServiceTemplate.new_with_id(new_id, @client)
|
414
|
+
rc = doc.info
|
415
|
+
|
416
|
+
return rc if OpenNebula.is_error?(rc)
|
417
|
+
|
418
|
+
body = JSON.parse(doc["TEMPLATE/#{TEMPLATE_TAG}"])
|
419
|
+
|
420
|
+
# add registration time, as the template is new
|
421
|
+
body['registration_time'] = Integer(Time.now)
|
422
|
+
|
423
|
+
# update the template with the new body
|
424
|
+
DocumentJSON.instance_method(:update).bind(doc).call(body.to_json)
|
425
|
+
|
426
|
+
# return the new document ID
|
427
|
+
new_id
|
428
|
+
end
|
429
|
+
|
394
430
|
# Replaces the raw template contents
|
395
431
|
#
|
396
432
|
# @param template [String] New template contents, in the form KEY = VAL
|
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.0.0
|
4
|
+
version: 6.0.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- OpenNebula
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-04-
|
11
|
+
date: 2021-04-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -223,8 +223,8 @@ files:
|
|
223
223
|
- lib/opennebula/xml_element.rb
|
224
224
|
- lib/opennebula/xml_pool.rb
|
225
225
|
- lib/opennebula/xml_utils.rb
|
226
|
-
- lib/opennebula/zone.rb
|
227
226
|
- lib/opennebula/zone_pool.rb
|
227
|
+
- lib/opennebula/zone.rb
|
228
228
|
- lib/opennebula/flow/grammar.rb
|
229
229
|
- lib/opennebula/flow/service_pool.rb
|
230
230
|
- lib/opennebula/flow/service_template.rb
|