Sha256: 7b4e178c8e6429d69b7042f82df49d47436481ca94edcc36ba4fd08e99449c43

Contents?: true

Size: 753 Bytes

Versions: 51

Compression:

Stored size: 753 Bytes

Contents

require 'open3'
puts "starting"
command = "foreman-sosreport " +
					"--batch " + 
					"-o rpm,libvirt,general,networking,hardware,process,yum,filesys,devicemapper" +
					",kernel,apache,memory "+
					"-k general.all_logs=True " +
					"-k apache.log=True " +
					"-k rpm.rpmva=off"
puts "running command"+ command
#system command
puts "done runnng "

puts "run with opens3"

Open3.popen3(command) do |stdin, stdout, stderr, wait_thr|
  pid = wait_thr.pid # pid of the started process.
  #puts stdout.readlines
  report_location = ''
  if wait_thr.value == 0 
  	stdout.readlines.each do |line|
  		if line.include? "tar.xz"
  			report_location = line
  			break
  		end
  	end
  else
  	puts "sos report failed"
  end
  puts report_location
end

Version data entries

51 entries across 51 versions & 1 rubygems

Version Path
redhat_access-2.0.10 test/sos-report-test.rb
redhat_access-2.0.9 test/sos-report-test.rb
redhat_access-2.0.8 test/sos-report-test.rb
redhat_access-2.0.7 test/sos-report-test.rb
redhat_access-2.0.6 test/sos-report-test.rb
redhat_access-2.0.5 test/sos-report-test.rb
redhat_access-2.0.4 test/sos-report-test.rb
redhat_access-2.0.3 test/sos-report-test.rb
redhat_access-2.0.2 test/sos-report-test.rb
redhat_access-2.0.1 test/sos-report-test.rb
redhat_access-2.0.0 test/sos-report-test.rb