Sha256: c48729eb36b8df483be963fd50aac91f6c76ba68840ebc467a1a41f206a47897

Contents?: true

Size: 643 Bytes

Versions: 14

Compression:

Stored size: 643 Bytes

Contents

require 'flydata/helper/base_action'
require 'flydata/util/shell'

module Flydata
  module Helper
    module Action
      class AgentAction <  BaseAction

        FLYDATA_CMD = "flydata %{command}"
        def execute(opts = {})
          cmd = FLYDATA_CMD % { command: command }
          log_debug("Executing #{cmd}")
          o, e, s = Util::Shell.run_cmd(cmd)
          log_error(e) if not e.to_s.empty?
          log.error("Could not execute #{cmd}. Response status : #{s}") unless (s.to_i == 0)
        end

        # Override this. Needs to be implemented by the subclass
        #def command
        #end
      end
    end
  end
end 

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
flydata-0.5.9 lib/flydata/helper/action/agent_action.rb
flydata-0.5.8 lib/flydata/helper/action/agent_action.rb
flydata-0.5.7 lib/flydata/helper/action/agent_action.rb
flydata-0.5.6 lib/flydata/helper/action/agent_action.rb
flydata-0.5.5 lib/flydata/helper/action/agent_action.rb
flydata-0.5.4 lib/flydata/helper/action/agent_action.rb
flydata-0.5.3 lib/flydata/helper/action/agent_action.rb
flydata-0.5.2 lib/flydata/helper/action/agent_action.rb
flydata-0.5.1 lib/flydata/helper/action/agent_action.rb
flydata-0.5.0 lib/flydata/helper/action/agent_action.rb
flydata-0.4.3 lib/flydata/helper/action/agent_action.rb
flydata-0.4.2 lib/flydata/helper/action/agent_action.rb
flydata-0.4.1 lib/flydata/helper/action/agent_action.rb
flydata-0.4.0 lib/flydata/helper/action/agent_action.rb