module Cumulus::StatusCodes

Public: Provide methods for setting the status code that

Cumulus should exit with

Constants

DIFFS

Indicates that there were diffs

EXCEPTION

Indicates there was an exception during execution

OK

Indicates that we are exiting normally

SYNC_DIFFS

Indicates that there were diffs and they were synced

Public Class Methods

set_status(status) click to toggle source

Public: Sets the status code if it is more severe than the current status code

# File lib/util/StatusCodes.rb, line 25
def set_status(status)

  # Only set the status if we are not already in exception state
  if @@CURRENT_STATUS != EXCEPTION

    # Only set the status if it is more severe (higher) than the current status
    if status > @@CURRENT_STATUS
      @@CURRENT_STATUS = status
    end

  end
end