Class: Command::CrowbarNodeList

Inherits:
CrowbarCommand show all
Defined in:
lib/command/crowbar_node_list.rb

Overview

CrowbarCommand implementation for list Crowbar nodes.

Author:

  • aboudot

Instance Attribute Summary collapse

Attributes inherited from BasicCommand

#logger, #receiver

Instance Method Summary collapse

Constructor Details

#initialize(logger, state = nil) ⇒ CrowbarNodeList

Default constructor

Parameters:

  • logger (logger)

    The logger

  • state (String) (defaults to: nil)

    The state wanted

Author:

  • mbretaud



25
26
27
28
29
# File 'lib/command/crowbar_node_list.rb', line 25

def initialize(logger, state = nil)
  super(logger)
  @logger.info("Command::CrowbarNodeList   initialize the parameters...")
  @state_filter = state
end

Instance Attribute Details

#state_filterObject (readonly)

Returns the value of attribute state_filter.



18
19
20
# File 'lib/command/crowbar_node_list.rb', line 18

def state_filter
  @state_filter
end

Instance Method Details

#execObject

Run the command on receiver.

Returns:

  • The list of nodes



35
36
37
38
# File 'lib/command/crowbar_node_list.rb', line 35

def exec()
  @logger.info("Command::CrowbarNodeList : call the receiver with the function 'crowbar_node_list_nodes(#{@state_filter})'")
  return @receiver.crowbar_node_list_nodes(@state_filter)
end