serverspec 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -7,9 +7,9 @@ module Serverspec
7
7
  options = Net::SSH::Config.for(host)
8
8
  user = options[:user] || Etc.getlogin
9
9
 
10
- ret = {}
10
+ ret = nil
11
11
  Net::SSH.start(host, user, options) do |ssh|
12
- ret = ssh_exec!(ssh, cmd)
12
+ ret = ssh_exec!(ssh, "sudo #{cmd}")
13
13
  end
14
14
  ret
15
15
  end
@@ -21,10 +21,11 @@ module Serverspec
21
21
  exit_code = nil
22
22
  exit_signal = nil
23
23
  ssh.open_channel do |channel|
24
- channel.exec(command) do |ch, success|
25
- unless success
26
- abort "FAILED: couldn't execute command (ssh.channel.exec)"
27
- end
24
+ channel.request_pty do |ch, success|
25
+ abort "Could not obtain pty " if !success
26
+ end
27
+ channel.exec("#{command}") do |ch, success|
28
+ abort "FAILED: couldn't execute command (ssh.channel.exec)" if !success
28
29
  channel.on_data do |ch,data|
29
30
  stdout_data += data
30
31
  end
@@ -1,3 +1,3 @@
1
1
  module Serverspec
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: serverspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: