mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-26 06:50:09 +03:00
Feature #1304: Check that the requested Document has the right type
This commit is contained in:
parent
a76982070a
commit
67641049a9
@ -84,7 +84,13 @@ module OpenNebula
|
||||
# @return [nil, OpenNebula::Error] nil in case of success, Error
|
||||
# otherwise
|
||||
def info()
|
||||
super(DOCUMENT_METHODS[:info], 'DOCUMENT')
|
||||
rc = super(DOCUMENT_METHODS[:info], 'DOCUMENT')
|
||||
|
||||
if !OpenNebula.is_error?(rc) && self['TYPE'].to_i != document_type
|
||||
return OpenNebula::Error.new("[DocumentInfo] Error getting document [#{@pe_id}].")
|
||||
end
|
||||
|
||||
return rc
|
||||
end
|
||||
|
||||
# Allocates a new Document in OpenNebula
|
||||
|
Loading…
x
Reference in New Issue
Block a user