summaryrefslogtreecommitdiff
path: root/lib/leap_cli/ssh/scripts.rb
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2016-06-29 16:55:06 -0700
committerelijah <elijah@riseup.net>2016-07-01 14:48:42 -0700
commit5780f5dcc024d4f140fe8f6e8dc3f7c4e905a8ec (patch)
treed68e366f74129f0fcad06fc415f9ab0e65ead50f /lib/leap_cli/ssh/scripts.rb
parente03bfce9db2a213527beb16a4f4dd1f13d96be6e (diff)
leap cli: move everything we can from leap_cli to leap_platform
Diffstat (limited to 'lib/leap_cli/ssh/scripts.rb')
-rw-r--r--lib/leap_cli/ssh/scripts.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/leap_cli/ssh/scripts.rb b/lib/leap_cli/ssh/scripts.rb
index 3d8b6570..feefdd46 100644
--- a/lib/leap_cli/ssh/scripts.rb
+++ b/lib/leap_cli/ssh/scripts.rb
@@ -15,7 +15,7 @@ module LeapCli
REQUIRED_PACKAGES = "puppet rsync lsb-release locales"
attr_reader :ssh, :host
- def initialize(backend, host)
+ def initialize(backend, hostname)
@ssh = backend
@host = host
end
@@ -48,6 +48,8 @@ module LeapCli
def check_for_no_deploy
begin
ssh.stream "test ! -f /etc/leap/no-deploy", :raise_error => true, :log_output => false
+ rescue SSH::TimeoutError
+ raise
rescue SSH::ExecuteError
ssh.log :warning, "can't continue because file /etc/leap/no-deploy exists", :host => host
raise # will skip further action on this node
@@ -59,7 +61,7 @@ module LeapCli
#
def debug
output = ssh.capture "#{Leap::Platform.leap_dir}/bin/debug.sh"
- ssh.log(output, :wrap => true, :host => host.hostname, :color => :cyan)
+ ssh.log(output, :wrap => true, :host => host, :color => :cyan)
end
#
@@ -69,7 +71,7 @@ module LeapCli
cmd = "(test -s /var/log/leap/deploy-summary.log && tail -n #{lines} /var/log/leap/deploy-summary.log) || (test -s /var/log/leap/deploy-summary.log.1 && tail -n #{lines} /var/log/leap/deploy-summary.log.1) || (echo 'no history')"
history = ssh.capture(cmd, :log_output => false)
if history
- ssh.log host.hostname, :color => :cyan, :style => :bold do
+ ssh.log host, :color => :cyan, :style => :bold do
ssh.log history, :wrap => true
end
end