opennebula 6.0.0 → 6.0.0.1

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: 6198250d78ce52345198a1d86230f430589cef5c
4
- data.tar.gz: 3caf470ee5faab9e3c09576f79ad781db3653803
3
+ metadata.gz: 6f9aa7355cf72de3df70da8d7fceb82907f97396
4
+ data.tar.gz: 749eef5d47ae22112fb3c8c1a1dc1d7f313ab5a7
5
5
  SHA512:
6
- metadata.gz: 4695c98d18bdd50b28c5f185e7bdb6e2bc1ef153562d5c690635af667a954edd78ab3073f014aa5c9059e755d9f1ab34859004bf88ffd6e99853a47acb5a0bc4
7
- data.tar.gz: ada07168177c2121930a8f0707329f23a34cc91a28f2e3f45d0f24a926bd0682d188a7ba04b4b144c1d9ad1427ebe9b41cedf6a523e84e0eefc1f141966513fc
6
+ metadata.gz: ba3c4cfcf52af7756cdc67ccefb827e773bf60c5b38a2b8ba32e1dc232582edbb57e1e45994168052e0cc572f14b9d70c4504cb7ea82796122df5f6564609d56
7
+ data.tar.gz: 40ecec9f0e8f2cd10ea50241e97a0554eb6e14204feaf0780879990373415d5eaaceea254efb7cb09b112ffb464ebc7324a17fb980d6306edfef92816c29a745
@@ -51,7 +51,7 @@ end
51
51
  module CloudClient
52
52
 
53
53
  # OpenNebula version
54
- VERSION = '6.0.0'
54
+ VERSION = '6.0.0.1'
55
55
 
56
56
  # #########################################################################
57
57
  # Default location for the authentication file
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.0.0'
80
+ VERSION = '6.0.0.1'
81
81
  end
@@ -357,7 +357,15 @@ module OpenNebula
357
357
 
358
358
  break rc if OpenNebula.is_error?(rc)
359
359
 
360
- rc = template.clone("#{template.name}-#{name}", recursive)
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-06 00:00:00.000000000 Z
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