module DopCommon::RunOptions

Public Instance Methods

canary_host() click to toggle source
# File lib/dop_common/run_options.rb, line 26
def canary_host
  @canary_host ||= canary_host_valid? ?
    @hash[:canary_host] : false
end
max_in_flight() click to toggle source
# File lib/dop_common/run_options.rb, line 16
def max_in_flight
  @max_in_flight ||= max_in_flight_valid? ?
    @hash[:max_in_flight] : nil
end
max_per_role() click to toggle source
# File lib/dop_common/run_options.rb, line 21
def max_per_role
  @max_per_role ||= max_per_role_valid? ?
    @hash[:max_per_role] : nil
end
valitdate_shared_options() click to toggle source
# File lib/dop_common/run_options.rb, line 10
def valitdate_shared_options
  log_validation_method('max_in_flight_valid?')
  log_validation_method('max_per_role_valid?')
  log_validation_method('canary_host_valid?')
end

Private Instance Methods

canary_host_valid?() click to toggle source
# File lib/dop_common/run_options.rb, line 49
def canary_host_valid?
  return false if @hash[:canary_host].nil?
  @hash[:canary_host].kind_of?(TrueClass) or @hash[:canary_host].kind_of?(FalseClass) or
    raise PlanParsingError, "Step #{@name}: The value for canary_host must be boolean"
end
max_in_flight_valid?() click to toggle source
# File lib/dop_common/run_options.rb, line 33
def max_in_flight_valid?
  return false if @hash[:max_in_flight].nil? # max_in_flight is optional
  @hash[:max_in_flight].kind_of?(Fixnum) or
    raise PlanParsingError, 'Plan: max_in_flight has to be a number'
  @hash[:max_in_flight] >= -1 or
    raise PlanParsingError, 'Plan: max_in_flight has to be greater than -1'
end
max_per_role_valid?() click to toggle source
# File lib/dop_common/run_options.rb, line 41
def max_per_role_valid?
  return false if @hash[:max_per_role].nil? # max_per_role is optional
  @hash[:max_per_role].kind_of?(Fixnum) or
    raise PlanParsingError, 'Plan: max_per_role has to be a number'
  @hash[:max_per_role] >= -1 or
    raise PlanParsingError, 'Plan: max_per_role has to be greater than -1'
end