1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-19 06:50:07 +03:00

Feature 2335 (#3313)

* F #3112: Bugs fixed

* F #2335: Implement clear and clear_all methods
This commit is contained in:
sergiojvg 2019-05-10 04:08:12 -05:00 committed by Tino Vázquez
parent 983c154d7a
commit 59b7a1beb0
2 changed files with 10 additions and 0 deletions

View File

@ -53,6 +53,15 @@ module Memoize
@memoize[property] = current_item
end
def clear(property)
@memoize = {} if !defined?(@memoize)
@memoize.clear[property] if @memoize[property]
end
def clear_all
@memoize = {}
end
def []=(property, value)
@memoize = {} if !defined?(@memoize)

View File

@ -2236,6 +2236,7 @@ class VirtualMachine < VCenterDriver::Template
end
def has_snapshots?
self.clear('rootSnapshot')
self['rootSnapshot'] && !self['rootSnapshot'].empty?
end