Class: CommandBase

Inherits:
Object
  • Object
show all
Defined in:
lib/setup_oob/command/base.rb

Overview

The base class for a command

Direct Known Subclasses

DRACCommandBase, SMCCommandBase

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(host, logger, data) ⇒ CommandBase

Returns a new instance of CommandBase.



21
22
23
24
25
26
# File 'lib/setup_oob/command/base.rb', line 21

def initialize(host, logger, data)
  @host = host
  @logger = logger
  # data is any extra data subcommands might need
  @data = data
end

Instance Attribute Details

#loggerObject

Returns the value of attribute logger.



19
20
21
# File 'lib/setup_oob/command/base.rb', line 19

def logger
  @logger
end

Instance Method Details

#converge!Object



34
35
36
37
# File 'lib/setup_oob/command/base.rb', line 34

def converge!
  logger.info("Validating #{pretty_self}")
  _converge!
end

#converged?Boolean

Returns:

  • (Boolean)


28
29
30
31
32
# File 'lib/setup_oob/command/base.rb', line 28

def converged?
  converged = _converged?
  logger.info("#{pretty_self}: converged: #{converged}")
  converged
end