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.



286
287
288
289
# File 'lib/smartos-manager/core.rb', line 286

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

Instance Method Details

#failed_connectionsObject



300
301
302
# File 'lib/smartos-manager/core.rb', line 300

def failed_connections
  []
end

#run_on_all(cmd) ⇒ Object



291
292
293
294
295
296
297
298
# File 'lib/smartos-manager/core.rb', line 291

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