1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-04-01 06:50:25 +03:00

M #-: add extra info into provision doc (#537)

This commit is contained in:
Alejandro Huertas Herrero 2020-12-10 11:15:00 +01:00 committed by GitHub
parent 2dd2c17e05
commit 6df1cd1702
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 33 additions and 0 deletions

View File

@ -503,6 +503,9 @@ module OneProvision
# Resources are allocated later
document['provision']['resource'] = {}
# Add extra information to the document
document.merge!(template.extra)
document.to_json
end

View File

@ -316,6 +316,36 @@ module OneProvision
dsearch(path.split('/'))
end
# Gets extra information from the template
#
# @return [Hash] Extra information
def extra
ret = {}
reject = %w[cluster
datastores
defaults
extends
flowtemplates
hosts
images
inputs
marketplaceapps
name
networks
playbook
templates
vntemplates]
@config.each do |key, value|
next if reject.include?(key)
ret[key] = value
end
ret
end
private
# Reads configuration content