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:
parent
b62e0f1ee4
commit
56e8c81a17
@ -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
|
||||
#
|
||||
|
@ -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")
|
||||
|
@ -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
|
||||
#
|
||||
|
Loading…
x
Reference in New Issue
Block a user