1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-20 10:50:08 +03:00

M #-: add provider type to plain section (#621)

This commit is contained in:
Alejandro Huertas Herrero 2021-01-12 11:04:48 +01:00 committed by Tino Vazquez
parent 311f8da6cc
commit 11da30efb8
No known key found for this signature in database
GPG Key ID: 14201E424D02047E

View File

@ -49,9 +49,31 @@ module OneProvision
return OpenNebula::Error.new(e)
end
template['plain'] ||= {}
template['plain']['provider'] = template['provider']
super(rc, template['name'], template['plain'])
end
# Replaces the template contents
#
# @param template_json [String] New template contents
# @param plain [Boolean] Update plain information
#
# @return [nil, OpenNebula::Error] nil in case of success, Error
# otherwise
def update(template_json = nil, plain = false)
# Provider is inmutable
if plain
template_json = JSON.parse(template_json)
template_json['provider'] = @body['provider']
template_json = template_json.to_json
end
super
end
# Delete provider
def delete
info(true)