Sha256: d8c4024fc7a42ece24e8e3747f6a40873376af36c7d8b31bbbb8ce128e4543d2
Contents?: true
Size: 1.3 KB
Versions: 14
Compression:
Stored size: 1.3 KB
Contents
module CORL module Action class Images < Plugin::CloudAction #----------------------------------------------------------------------------- # Settings def configure super do codes :node_load_failure, :image_load_failure register :region, :str, nil register :match_case, :bool, false register :require_all, :bool, true register :search, :array, [] end end #--- def ignore node_ignore - [ :node_provider ] end def arguments [ :node_provider, :search ] end #----------------------------------------------------------------------------- # Operations def execute super do |local_node, network| info('corl.actions.images.start') if node = network.test_node(settings[:node_provider], { :region => settings[:region] }) if images = node.images(settings[:search], settings) images.each do |image| render(node.render_image(image), { :prefix => false }) end myself.result = images success('corl.actions.images.results', { :images => images.length }) if images.length > 1 else myself.status = code.image_load_failure end else myself.status = code.node_load_failure end end end end end end
Version data entries
14 entries across 14 versions & 1 rubygems