Sha256: 148c94100571f717babd8c55979ed8a51816555cd2cce55197c85da853586dd7

Contents?: true

Size: 1.1 KB

Versions: 25

Compression:

Stored size: 1.1 KB

Contents

require 'veewee/provider/core/helper/ssh'
module Veewee
  module Provider
    module  Core
      module BoxCommand

        def scp(localfile,remotefile,options={})
          raise Veewee::Error,"Box is not running" unless self.running?
          begin
            new_options=ssh_options.merge(options)
            self.when_ssh_login_works(self.ip_address,new_options) do
              begin
                env.logger.info "About to transfer #{localfile} to #{remotefile} to the box #{name} - #{self.ip_address} - #{new_options.inspect}"
                self.ssh_transfer_file(self.ip_address,localfile,remotefile,new_options)
              rescue RuntimeError => ex
                ui.error("Error transfering file #{localfile} failed, possible not enough permissions to write? #{ex}",:prefix => false)
                raise Veewee::SshError,ex
              end
            end
          rescue Net::SSH::AuthenticationFailed => ex
            ui.error("Authentication failure",:prefix => false)
            raise Veewee::SshError,ex
          end

        end
      end # Module
    end # Module
  end # Module
end # Module

Version data entries

25 entries across 25 versions & 2 rubygems

Version Path
veewee-0.5.0.alpha4 lib/veewee/provider/core/box/scp.rb
veewee-0.5.0.alpha3 lib/veewee/provider/core/box/scp.rb
veewee-0.5.0.alpha2 lib/veewee/provider/core/box/scp.rb
veewee-0.5.0.alpha1 lib/veewee/provider/core/box/scp.rb
veewee-0.4.5.1 lib/veewee/provider/core/box/scp.rb
veewee-0.4.5 lib/veewee/provider/core/box/scp.rb
veewee-0.4.5.pre1 lib/veewee/provider/core/box/scp.rb
veewee-0.4.4 lib/veewee/provider/core/box/scp.rb
veewee-0.4.3 lib/veewee/provider/core/box/scp.rb
veewee-0.4.2 lib/veewee/provider/core/box/scp.rb
veewee-0.4.1 lib/veewee/provider/core/box/scp.rb
veewee-0.4.0 lib/veewee/provider/core/box/scp.rb
veewee-0.3.12 lib/veewee/provider/core/box/scp.rb
veewee-0.3.11 lib/veewee/provider/core/box/scp.rb
veewee-0.3.10 lib/veewee/provider/core/box/scp.rb
veewee-0.3.9 lib/veewee/provider/core/box/scp.rb
veewee-atlassian-0.3.11 lib/veewee/provider/core/box/scp.rb
veewee-0.3.7 lib/veewee/provider/core/box/scp.rb
veewee-0.3.6 lib/veewee/provider/core/box/scp.rb
veewee-0.3.5 lib/veewee/provider/core/box/scp.rb