Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CentOS 7 restart fix #2 #102

Merged
merged 1 commit into from
Nov 21, 2016
Merged

CentOS 7 restart fix #2 #102

merged 1 commit into from
Nov 21, 2016

Conversation

chorankates
Copy link
Owner

  • allowing restart() to be more flexible with exit codes

was catching a 256 exit code from the restart command, after 10-15 seconds. the reboot is/was initiated, but because we were expecting a 0, an uncaught exception was thrown

require sprintf('%s/../%s', File.dirname(File.expand_path(__FILE__)), 'path_helper')

require 'rouster'
require 'rouster/puppet'
require 'rouster/tests'

centos6 = Rouster.new(:name => 'centos6', :verbosity => 4, :sudo => true)
centos7 = Rouster.new(:name => 'centos7', :verbosity => 4, :sudo => true)

workers = [centos6, centos7]

workers.each do |w|
  p 'name[%]: ' % w.name
  p 'uptime:     %s' % w.run('uptime')
  p 'status: %s' % w.status()
  p 'rebooting...'
  w.restart(120)
  p 'status: %s' % w.status()
  p 'uptime: %s' % w.run('uptime')
end

exit

gives

name [centos6]:
"uptime:      18:22:48 up 5 min,  0 users,  load average: 0.00, 0.02, 0.00\n"
"os type:    rhel"
"os version: 6.4"
"status: running"
"rebooting..."
"status: running"
"uptime:  18:23:49 up 0 min,  0 users,  load average: 0.25, 0.07, 0.02\n"


name [centos7]:
"uptime:      18:23:53 up 5 min,  0 users,  load average: 0.00, 0.00, 0.00\n"
"os type:    rhel"
"os version: 7"
"status: running"
"rebooting..."
"status: running"
"uptime:  18:24:20 up 0 min,  0 users,  load average: 0.00, 0.00, 0.00\n"

@chorankates chorankates merged commit 34dd8b4 into master Nov 21, 2016
@chorankates chorankates deleted the better-restart-handling branch November 21, 2016 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants