mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-09 14:03:20 +09:00
Feature 2335 (#3313)
* F #3112: Bugs fixed
* F #2335: Implement clear and clear_all methods
(cherry picked from commit 59b7a1beb0)
This commit is contained in:
1 parent
dd05b4353c
commit
34fe649e93
2 files changed
+10
No files matched your search
@@ -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)
|
||||
|
||||
|
||||
@@ -2236,6 +2236,7 @@ class VirtualMachine < VCenterDriver::Template
|
||||
end
|
||||
|
||||
def has_snapshots?
|
||||
self.clear('rootSnapshot')
|
||||
self['rootSnapshot'] && !self['rootSnapshot'].empty?
|
||||
end
|
||||
|
||||
|
||||
Reference in new issue
Block a user