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:
parent
ffe5dbf571
commit
486e3c49c4
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user