lib/serverspec/helper.rb in serverspec-0.1.1 vs lib/serverspec/helper.rb in serverspec-0.1.2
- old
+ new
@@ -1,10 +1,11 @@
require 'etc'
module Serverspec
module SshHelper
def ssh_exec(cmd, opt={})
- ssh_exec!("sudo #{cmd}")
+ cmd = "sudo #{cmd}" if not RSpec.configuration.ssh.options[:user] == 'root'
+ ssh_exec!(cmd)
end
private
def ssh_exec!(command)
stdout_data = ''