Sha256: 3d3844f05e3cbfe7b901e7c711a714c77e544e6780ebd1a8aed5daf27f95361c

Contents?: true

Size: 961 Bytes

Versions: 26

Compression:

Stored size: 961 Bytes

Contents

require "vagrant/util/busy"
require "vagrant/util/subprocess"

module VagrantPlugins
  module DockerProvider
    module Executor
      # The Local executor executes a Docker client that is running
      # locally.
      class Local
        def execute(*cmd, **opts, &block)
          # Append in the options for subprocess
          cmd << { notify: [:stdout, :stderr] }

          interrupted  = false
          int_callback = ->{ interrupted = true }
          result = ::Vagrant::Util::Busy.busy(int_callback) do
            ::Vagrant::Util::Subprocess.execute(*cmd, &block)
          end

          result.stderr.gsub!("\r\n", "\n")
          result.stdout.gsub!("\r\n", "\n")

          if result.exit_code != 0 && !interrupted
            raise Errors::ExecuteError,
              command: cmd.inspect,
              stderr: result.stderr,
              stdout: result.stdout
          end

          result.stdout
        end
      end
    end
  end
end

Version data entries

26 entries across 23 versions & 5 rubygems

Version Path
vagrant-aws-mkubenka-0.7.2.pre.22 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-f3fdbf414272/plugins/providers/docker/executor/local.rb
vagrant-aws-mkubenka-0.7.2.pre.16 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-1ee58c40e3f5/plugins/providers/docker/executor/local.rb
vagrant-unbundled-2.0.0.1 plugins/providers/docker/executor/local.rb
vagrant-unbundled-1.9.8.1 plugins/providers/docker/executor/local.rb
vagrant-unbundled-1.9.7.1 plugins/providers/docker/executor/local.rb
vagrant-aws-mkubenka-0.7.2.pre.14 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-5333e60e2d38/plugins/providers/docker/executor/local.rb
vagrant-aws-mkubenka-0.7.2.pre.11 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-5333e60e2d38/plugins/providers/docker/executor/local.rb
vagrant-aws-mkubenka-0.7.2.pre.10 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-5333e60e2d38/plugins/providers/docker/executor/local.rb
vagrant-aws-mkubenka-0.7.2.pre.9 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-5333e60e2d38/plugins/providers/docker/executor/local.rb
vagrant-unbundled-1.9.5.1 plugins/providers/docker/executor/local.rb
vagrant-unbundled-1.9.1.1 plugins/providers/docker/executor/local.rb
vagrant-compose-yaml-0.1.3 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/plugins/providers/docker/executor/local.rb
vagrant-compose-yaml-0.1.2 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/plugins/providers/docker/executor/local.rb
vagrant-compose-yaml-0.1.1 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/plugins/providers/docker/executor/local.rb
vagrant-compose-yaml-0.1.0 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/plugins/providers/docker/executor/local.rb
vagrant-unbundled-1.8.5.2 plugins/providers/docker/executor/local.rb
vagrant-unbundled-1.8.5.1 plugins/providers/docker/executor/local.rb
vagrant-unbundled-1.8.4.2 plugins/providers/docker/executor/local.rb
vagrant-unbundled-1.8.4.1 plugins/providers/docker/executor/local.rb
vagrant-unbundled-1.8.1.2 plugins/providers/docker/executor/local.rb