Module: DopCommon

Defined in:
lib/dop_common/step.rb,
lib/dop_common.rb,
lib/dop_common/dns.rb,
lib/dop_common/log.rb,
lib/dop_common/node.rb,
lib/dop_common/plan.rb,
lib/dop_common/hooks.rb,
lib/dop_common/utils.rb,
lib/dop_common/config.rb,
lib/dop_common/cli/log.rb,
lib/dop_common/command.rb,
lib/dop_common/network.rb,
lib/dop_common/version.rb,
lib/dop_common/step_set.rb,
lib/dop_common/data_disk.rb,
lib/dop_common/interface.rb,
lib/dop_common/validator.rb,
lib/dop_common/credential.rb,
lib/dop_common/plan_cache.rb,
lib/dop_common/plan_store.rb,
lib/dop_common/hash_parser.rb,
lib/dop_common/node/config.rb,
lib/dop_common/node_filter.rb,
lib/dop_common/run_options.rb,
lib/dop_common/state_store.rb,
lib/dop_common/config/helper.rb,
lib/dop_common/configuration.rb,
lib/dop_common/pre_processor.rb,
lib/dop_common/affinity_group.rb,
lib/dop_common/infrastructure.rb,
lib/dop_common/signal_handler.rb,
lib/dop_common/cli/global_options.rb,
lib/dop_common/cli/node_selection.rb,
lib/dop_common/thread_context_logger.rb,
lib/dop_common/infrastructure_properties.rb

Overview

DOP Common infrastructure properties parser

Defined Under Namespace

Modules: Cli, HashParser, NodeFilter, RunOptions, Utils, Validator Classes: AffinityGroup, Command, Config, Configuration, ConfigurationValueNotFound, Credential, DNS, DataDisk, Hooks, Infrastructure, InfrastructureProperties, Interface, Network, Node, Plan, PlanCache, PlanExistsError, PlanParsingError, PlanStore, PreProcessor, SignalHandler, StateStore, Step, StepSet, ThreadContextLogger, UnknownVersionError

Constant Summary collapse

VERSION =
'0.15.3'

Class Method Summary collapse

Class Method Details

.add_log_filter(filter_proc) ⇒ Object



36
37
38
# File 'lib/dop_common/log.rb', line 36

def self.add_log_filter(filter_proc)
  log_filters << filter_proc
end

.add_log_junction(logger) ⇒ Object



44
45
46
# File 'lib/dop_common/log.rb', line 44

def self.add_log_junction(logger)
  log_junctions << logger
end

.configObject



15
16
17
# File 'lib/dop_common/config.rb', line 15

def self.config
  @config ||= Config.new
end

.configure {|config| ... } ⇒ Object

Yields:



19
20
21
# File 'lib/dop_common/config.rb', line 19

def self.configure
  yield config
end

.configure=(options_hash) ⇒ Object



23
24
25
26
27
28
29
30
# File 'lib/dop_common/config.rb', line 23

def self.configure=(options_hash)
  options_hash.each do |key, value|
    variable_name = '@' + key.to_s
    if config.instance_variable_defined?( variable_name )
      config.instance_variable_set( variable_name , value )
    end
  end
end

.formatterObject



18
19
20
# File 'lib/dop_common/log.rb', line 18

def self.formatter
  @formatter ||= Logger::Formatter.new
end

.formatter=(formatter_proc) ⇒ Object



22
23
24
# File 'lib/dop_common/log.rb', line 22

def self.formatter=(formatter_proc)
  @formatter ||= formatter_proc
end

.logObject



9
10
11
# File 'lib/dop_common/log.rb', line 9

def self.log
  @log ||= create_logger(STDOUT)
end

.log_filtersObject



32
33
34
# File 'lib/dop_common/log.rb', line 32

def self.log_filters
  @log_filters ||= []
end

.log_junctionsObject



40
41
42
# File 'lib/dop_common/log.rb', line 40

def self.log_junctions
  @log_junction ||= []
end

.logger=(logger) ⇒ Object



13
14
15
16
# File 'lib/dop_common/log.rb', line 13

def self.logger=(logger)
  logger.formatter = DopCommon.filter_formatter
  @log = logger
end

.remove_log_junction(logger) ⇒ Object



48
49
50
# File 'lib/dop_common/log.rb', line 48

def self.remove_log_junction(logger)
  log_junctions.delete(logger)
end

.reset_loggerObject



26
27
28
29
30
# File 'lib/dop_common/log.rb', line 26

def self.reset_logger
  @log = nil
  @log_filters = []
  @log_junction = []
end