Class: Command::NodeInstall

Inherits:
CrowbarNodeCommand show all
Defined in:
lib/command/node_install.rb

Overview

Allows to install node

Instance Attribute Summary collapse

Attributes inherited from BasicCommand

#logger, #receiver

Instance Method Summary collapse

Constructor Details

#initialize(node_name, bios_name = nil, raid_name = nil) ⇒ NodeInstall

Default constructor

Parameters:

  • node_name (String)

    The name of the node

  • bios_name (String) (defaults to: nil)

    The name of the bios

  • raid_name (String) (defaults to: nil)

    The name of the raid

Author:

  • mbretaud



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

def initialize(node_name, bios_name = nil, raid_name = nil)
  super()
  @logger.info("Command::NodeInstall   initialize the parameters...")
  @node_name = node_name
  @bios_name = bios_name
  @raid_name = raid_name
end

Instance Attribute Details

#bios_nameObject (readonly)

Returns the value of attribute bios_name.



11
12
13
# File 'lib/command/node_install.rb', line 11

def bios_name
  @bios_name
end

#node_nameObject (readonly)

Returns the value of attribute node_name.



10
11
12
# File 'lib/command/node_install.rb', line 10

def node_name
  @node_name
end

#raid_nameObject (readonly)

Returns the value of attribute raid_name.



12
13
14
# File 'lib/command/node_install.rb', line 12

def raid_name
  @raid_name
end

Instance Method Details

#execObject

Method to call crowbar receiver for install a node

Author:

  • mbretaud



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/command/node_install.rb', line 30

def exec()
  if @raid_name.nil?
    @raid_name = "JBODOnly"
  end

  if !@bios_name.nil? && !@raid_name.nil?
    @receiver.crowbar_set_bios_raid(@node_name, @bios_name, @raid_name)
  end

  if @bios_name.nil? && !@raid_name.nil?
    @receiver.crowbar_set_raid(@node_name, @raid_name)
  end

  @receiver.crowbar_node_install(@node_name)
end