Class: Chef::Application::ExitCode

Inherits:
Object
  • Object
show all
Defined in:
lib/chef/application/exit_code.rb

Overview

These are the exit codes defined in Chef RFC 062 github.com/chef/chef-rfc/blob/master/rfc062-exit-status.md

Constant Summary collapse

VALID_RFC_062_EXIT_CODES =

-1 is defined as DEPRECATED_FAILURE in RFC 062, so it is not enumerated in an active constant.

{
  SUCCESS: 0,
  GENERIC_FAILURE: 1,
  SIGINT_RECEIVED: 2,
  SIGTERM_RECEIVED: 3,
  REBOOT_SCHEDULED: 35,
  REBOOT_NEEDED: 37,
  REBOOT_FAILED: 41,
  AUDIT_MODE_FAILURE: 42,
}
DEPRECATED_RFC_062_EXIT_CODES =
{
  DEPRECATED_FAILURE: -1,
}

Class Method Summary collapse

Class Method Details

.enforce_rfc_062_exit_codes?Boolean

Returns:

  • (Boolean)


56
57
58
# File 'lib/chef/application/exit_code.rb', line 56

def enforce_rfc_062_exit_codes?
  !normalization_disabled? && !normalization_not_configured?
end

.normalize_exit_code(exit_code = nil) ⇒ Object



46
47
48
49
50
51
52
53
54
# File 'lib/chef/application/exit_code.rb', line 46

def normalize_exit_code(exit_code = nil)
  if normalization_not_configured?
    normalize_legacy_exit_code_with_warning(exit_code)
  elsif normalization_disabled?
    normalize_legacy_exit_code(exit_code)
  else
    normalize_exit_code_to_rfc(exit_code)
  end
end

.notify_deprecated_exit_codeObject



65
66
67
68
# File 'lib/chef/application/exit_code.rb', line 65

def notify_deprecated_exit_code
  return if normalization_disabled?
  notify_on_deprecation(deprecation_warning)
end

.notify_reboot_exit_code_deprecationObject



60
61
62
63
# File 'lib/chef/application/exit_code.rb', line 60

def notify_reboot_exit_code_deprecation
  return if normalization_disabled?
  notify_on_deprecation(reboot_deprecation_warning)
end