Commit 4e77ebf1 authored by Ash McKenzie's avatar Ash McKenzie

Runtime::Env.verbose? exists, no need for debug?

parent 68bf4a83
...@@ -111,21 +111,17 @@ module QA ...@@ -111,21 +111,17 @@ module QA
attr_reader :uri, :username, :password, :known_hosts_file, :private_key_file attr_reader :uri, :username, :password, :known_hosts_file, :private_key_file
def debug?
Runtime::Env.respond_to?(:verbose?) && Runtime::Env.verbose?
end
def ssh_key_set? def ssh_key_set?
!private_key_file.nil? !private_key_file.nil?
end end
def run(command_str) def run(command_str)
command = [env_vars, command_str, '2>&1'].compact.join(' ') command = [env_vars, command_str, '2>&1'].compact.join(' ')
warn "DEBUG: command=[#{command}]" if debug? warn "DEBUG: command=[#{command}]" if Runtime::Env.verbose?
output, _ = Open3.capture2(command) output, _ = Open3.capture2(command)
output = output.chomp.gsub(/\s+$/, '') output = output.chomp.gsub(/\s+$/, '')
warn "DEBUG: output=[#{output}]" if debug? warn "DEBUG: output=[#{output}]" if Runtime::Env.verbose?
output output
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment