Class: CachedRegistry

Inherits:
Registry show all
Defined in:
lib/smartos-manager/core.rb

Constant Summary

Constants inherited from Registry

Registry::LIST_COLUMNS

Instance Attribute Summary

Attributes inherited from Registry

#user_columns

Instance Method Summary collapse

Methods inherited from Registry

#diag, #find_host, #list_images, #list_vms, #sysinfo

Constructor Details

#initializeCachedRegistry

Returns a new instance of CachedRegistry.



289
290
291
292
# File 'lib/smartos-manager/core.rb', line 289

def initialize(*)
  puts "(( Using cached data ))"
  super
end

Instance Method Details

#failed_connectionsObject



303
304
305
# File 'lib/smartos-manager/core.rb', line 303

def failed_connections
  []
end

#run_on_all(cmd) ⇒ Object



294
295
296
297
298
299
300
301
# File 'lib/smartos-manager/core.rb', line 294

def run_on_all(cmd)
  if @cache[@cache_key] && @cache[@cache_key][cmd]
    @cache[@cache_key][cmd]
  else
    puts "[#{@cache_key}] missing cache for cmd: '#{cmd}'"
    {}
  end
end