lib/shaddox/target.rb in shaddox-0.0.11 vs lib/shaddox/target.rb in shaddox-0.0.12
- old
+ new
@@ -52,11 +52,11 @@
# Execute the shadow script:
info "Executing shadow script", 1
raise TargetError, "Shadow script was not executed successfully." unless exec "ruby #{shadow_script_path}"
rm_tmpdir.call() unless opts[:keep_tmp_dir]
- rescue => e
+ rescue Exception => e
# Make sure the tmpdir is removed even if the provisioning fails:
rm_tmpdir.call() unless opts[:keep_tmp_dir]
raise e
end
end
@@ -119,9 +119,10 @@
end
def exec(command)
exit_code = nil
@ssh.open_channel do |channel|
channel.exec(command) do |ch, success|
+ ch.request_pty :want_reply => true
#return nil if !success
ch.on_data do |ch, data|
$stdout.print data
if data =~ /^\[sudo\]|Password/i
channel.send_data(gets.strip)