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

M #-: minor change in provider update operation (#441)

This commit is contained in:
Alejandro Huertas Herrero 2020-11-18 18:56:20 +01:00 committed by GitHub
parent b62e0f1ee4
commit 56e8c81a17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -22,7 +22,7 @@ module OneProvision
DOCUMENT_TYPE = 102
# These attributes can not be changed when updating the provider
UNMUTABLE_ATTRS = %w[provider]
IMMUTABLE_ATTRS = %w[provider]
# Allocates a new document
#

View File

@ -47,11 +47,11 @@ module OneProvision
if template_json
template_json = JSON.parse(template_json)
if template_json.keys != @body.keys
if template_json.keys.sort != @body.keys.sort
return OpenNebula::Error.new('Keys can not be changed')
end
self.class::UNMUTABLE_ATTRS.each do |attr|
self.class::IMMUTABLE_ATTRS.each do |attr|
next if template_json[attr] == @body[attr]
return OpenNebula::Error.new("`#{attr}` can not be changed")

View File

@ -23,7 +23,7 @@ module OneProvision
DOCUMENT_TYPE = 104
# These attributes can not be changed when updating the template
UNMUTABLE_ATTRS = %w[name provider]
IMMUTABLE_ATTRS = %w[name provider]
# Allocates a new document
#