Sha256: 539da021a1f41661dc6fc6813bd85c52ff758f785bfaa2325c4dc46797ff9c75

Contents?: true

Size: 811 Bytes

Versions: 6

Compression:

Stored size: 811 Bytes

Contents

module Actions
  module RemoteExecution
    class RunProxyCommand < Actions::ProxyAction

      include ::Dynflow::Action::Cancellable

      def plan(proxy, hostname, script, options = {})
        options = { :effective_user => nil }.merge(options)
        super(proxy, options.merge(:hostname => hostname, :script => script))
      end

      def proxy_action_name
        'Proxy::RemoteExecution::Ssh::CommandAction'
      end

      def on_data(data)
        super(data)
        error! _("Script execution failed") if failed_run?
      end

      def rescue_strategy
        ::Dynflow::Action::Rescue::Skip
      end

      def failed_run?
        exit_status && proxy_output[:exit_status] != 0
      end

      def exit_status
        proxy_output && proxy_output[:exit_status]
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
foreman_remote_execution-0.0.6 app/lib/actions/remote_execution/run_proxy_command.rb
foreman_remote_execution-0.0.5 app/lib/actions/remote_execution/run_proxy_command.rb
foreman_remote_execution-0.0.4 app/lib/actions/remote_execution/run_proxy_command.rb
foreman_remote_execution-0.0.3 app/lib/actions/remote_execution/run_proxy_command.rb
foreman_remote_execution-0.0.2 app/lib/actions/remote_execution/run_proxy_command.rb
foreman_remote_execution-0.0.1 app/lib/actions/remote_execution/run_proxy_command.rb