Class: Receiver::CrowbarReceiver

Inherits:
BasicReceiver show all
Defined in:
lib/receiver/crowbar_receiver.rb

Overview

Class listing all the available methods to interact with Crowbar

Instance Method Summary collapse

Constructor Details

#initialize(logger = nil) ⇒ CrowbarReceiver

Returns a new instance of CrowbarReceiver.



15
16
17
18
19
20
# File 'lib/receiver/crowbar_receiver.rb', line 15

def initialize(logger = nil)
  super(logger)
  @logger.info("Receiver::CrowbarReceiver   initialize the parameters...")
  @shell_connector = Receiver::CrowbarShellAPI.new(logger)
  @rest_connector = Receiver::CrowbarRestAPIConnector.new(logger) # @TODO gestion des confs
end

Instance Method Details

#check_cluster_name(cluster_name, barclamps_path) ⇒ Boolean (private)

Check if the name of the cluster is already used or not

Parameters:

  • cluster_name

    The name of the cluster

  • barclamps_path

    The path of the barclamp

Returns:

  • (Boolean)

    true if the name of the cluster is not used

Raises:

  • (ArgumentError)

    if the name of the cluster is already used

Author:

  • mbretaud



212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
# File 'lib/receiver/crowbar_receiver.rb', line 212

def check_cluster_name(cluster_name, barclamps_path)
  @logger.info("Exec::ClusterCreate   Check if the name of the cluster '#{cluster_name}' is already used or not...")

  list = Dir["#{barclamps_path}/cb*"]
  list.each { |dir|
    if File::directory?(dir)
      barclamp = File.basename(dir)
      vc_name = barclamp[2..-1]

      if vc_name == cluster_name
        raise Common::CheckClusterNameError.new("The vcluster '#{cluster_name}' is already in use by another virtual cluster.")
      end
    end
  }

  return true
end

#check_configuration_cluster_allocate(cluster_name, barclamps_path, all_nodes, list_nodes = nil) ⇒ Object (private)

Check the configuration of the cluster

Parameters:

  • cluster_name

    The vcluser name to allocate

  • barclamps_path

    The path of the barclamps

  • list_nodes (defaults to: nil)

    The list of nodes to allocate if the list is specified in options of the command

Returns:

  • true If the configuration is corrects

  • false If the configuration is not corrects

Author:

  • mbretaud



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# File 'lib/receiver/crowbar_receiver.rb', line 30

def check_configuration_cluster_allocate(cluster_name, barclamps_path, all_nodes, list_nodes = nil)
  @logger.info("Exec::ClusterCreate   Check the configuration for the vcluster '#{cluster_name}'...")

  proposal_name = "default"

  if list_nodes.nil?
    raise Common::CheckConfigurationClusterAllocateError.new("The list of nodes to allocate is not exists.")
  end

  cmd = Command::ClusterInfo.new(cluster_name, proposal_name)
  p = cmd.exec()

  if p.nil?
    raise Common::CheckConfigurationClusterAllocateError.new("The cluster '#{cluster_name}' don't exists!")
  end

  cmd = Command::CrowbarNodeList.new(@logger, "Ready")
  list1 = cmd.exec()

  list_node_ready = Array.new
  list1.each do |node|
    list_node_ready << node.split(" ").at(0).strip.to_s
  end

  cmd = Command::CrowbarNodeList.new(@logger, "Applying")
  list2 = cmd.exec()

  list_node_applying = Array.new
  list2.each do |node|
    list_node_applying << node.split(" ").at(0).strip.to_s
  end

  if list_node_applying.length > 0
    raise Common::CheckConfigurationClusterAllocateError.new("Some machines are Applying.")
  end

  available_machines = Array.new
  list_node_ready.each { |node|
    available_machines << node
  }

  vcluster_exists = false
  list = Dir["#{barclamps_path}/cb*"]
  list.each { |dir|
    if File::directory?(dir)
      barclamp = File.basename(dir)
      vc_name = barclamp[2..-1]

      if vc_name == cluster_name
        vcluster_exists = true
      end
    end
  }

  if !vcluster_exists
    raise Common::CheckConfigurationClusterAllocateError.new("The vcluster '#{cluster_name}' don't exists.")
  end

  if !available_machines.empty?
    # if all machine have to affected, get machines list by calling crowbar cmd
    if all_nodes && list_nodes != nil
      unknown_machines = Array.new
      list_nodes.each { |node|
        found = false
        available_machines.each { |node_available|
          if node == node_available
            found = true
            break 1
          end
        }

        if !found
          unknown_machines << node
        end
      }

      if !unknown_machines.empty?
        raise Common::CheckConfigurationClusterAllocateError.new("Unknown machine(s) have been setted: #{unknown_machines}.")
      end
    end
  else
    raise Common::CheckConfigurationClusterAllocateError.new("No machines are Ready.")
  end

  return "Check the configuration for the vcluster '#{cluster_name}'...  [ OK ]\n"
end

#check_network_address(network_address, barclamps_path, proposal_name) ⇒ Object (private)

Check if the network address is already used or not

Parameters:

  • network_address

    The address of the network

  • barclamps_path

    The path of the barclamp

  • proposal_name

    The name of the proposal

Returns:

  • true if the network address is not used

Raises:

  • (ArgumentError)

    if an error occurred while trying to get network address into all vclusters

  • (ArgumentError)

    if the the network address is already in use by another virtual cluster.

Author:

  • mbretaud



239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
# File 'lib/receiver/crowbar_receiver.rb', line 239

def check_network_address(network_address, barclamps_path, proposal_name)
  @logger.info("Exec::ClusterCreate   Check if the network address '#{network_address}' is already used or not...")

  list = Dir["#{barclamps_path}/cb*"]
  list.each { |dir|
    if File::directory?(dir)
      barclamp = File.basename(dir)
      vc_name = barclamp[2..-1]

      begin
        cmd = Command::ClusterInfo.new(vc_name, proposal_name)
        p = cmd.exec()

        if p['deployment'][barclamp] != nil
          if p['attributes'][barclamp]['network']['address'] != nil
            bc_network = p['attributes'][barclamp]['network']['address'].strip.to_s
          end
        end
      rescue
        raise Common::CheckNetworkAddressError.new("An error occurred while trying to get network address into all vclusters.
The proposal 'default' probably doesn't exist in a barclamp of one vcluster...
or the vcluster no longer exists.")
      end

      if network_address == bc_network
        raise Common::CheckNetworkAddressError.new("The network '#{network_address}' is already in use by another virtual cluster.")
      end
    end
  }

  return true
end

#check_vlan_id(vlan_id, cluster_name, barclamps_path, proposal_name) ⇒ Object (private)

Check if the vlan id is already used or not. If the id is already used, create a new vlan id.

Parameters:

  • vlan_id

    The id of the vlan

  • cluster_name

    The name of the cluster

  • proposal_name

    The name of the proposal

Returns:

  • vlan_id The id of the vlan

Raises:

  • (ArgumentError)

    if the name of the cluster is already used

Author:

  • mbretaud



125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
# File 'lib/receiver/crowbar_receiver.rb', line 125

def check_vlan_id(vlan_id, cluster_name, barclamps_path, proposal_name)
  @logger.info("Exec::ClusterCreate   Check if the vlan id '#{vlan_id}' is already used or not. If the id is already used, create a new vlan id...")

  vlan_ids = Array.new
  vlan_ids << "1" # id 1 have not to be used

  list = Dir["#{barclamps_path}/cb*"]
  list.each { |dir|
    if File::directory?(dir)
      barclamp = File.basename(dir)
      vc_name = barclamp[2..-1]

      if vc_name == cluster_name
        raise Common::CheckVlanIdError.new("The vcluster '#{cluster_name}' is already in use by another virtual cluster.")
      end

      begin
        cmd = Command::ClusterInfo.new(vc_name, proposal_name)
        p = cmd.exec()

        if p['deployment'][barclamp] != nil
          if p['attributes'][barclamp]['network']['idvlan'] != nil
            bc_vlan_id = p['attributes'][barclamp]['network']['idvlan'].strip.to_s
          end
        end
      rescue
        raise Common::CheckVlanIdError.new("An error occured while trying to get idvlan into all vclusters.
The proposal 'default' probably doesn't exist in a barclamp of one vcluster...
or the vcluster no longer exists.")
      end

      vlan_ids << "#{bc_vlan_id}"
    end
  }

  if vlan_id.nil? || vlan_id == ""
    ### Determining vlan id... ###
    new_vlan_id = ""

    (10..4094).to_a.each { |id|
      used = false

      vlan_ids.each { |already_used|
        if id.to_s == already_used
          used = true
          break
        end
      }

      unless used
        new_vlan_id = id
        break
      end
    }

    if new_vlan_id == ""
      raise Common::CheckVlanIdError.new("An error occured while trying to get network address into all vclusters.
The proposal 'default' probably doesn't exist in a barclamp of one vcluster...
or the vcluster no longer exists.")
    else
      vlan_id = new_vlan_id
    end
  else
    used = false

    vlan_ids.each { |already_used|
      if vlan_id == already_used
        used = true
        break
      end
    }

    if used
      raise Common::CheckVlanIdError.new("The vlan id '#{vlan_id}' is already used.")
    end
  end

  return vlan_id
end

#crowbar_allocate_cluster(cluster_name, all_nodes, list_node = nil) ⇒ Object

Allocate nodes on a vcluster

Parameters:

  • cluster_name

    The name of the vcluster

  • list_node (defaults to: nil)

    A list of nodes

Returns:

  • barclamps_path The name of the barclamp

Raises:

Author:



279
280
281
282
283
284
285
286
287
288
289
290
291
# File 'lib/receiver/crowbar_receiver.rb', line 279

def crowbar_allocate_cluster(cluster_name, all_nodes, list_node = nil)
  @logger.info("Receiver::CrowbarReceiver   Allocate nodes on the vcluster '#{cluster_name}'...")

  output = ""
  barclamps_path = "/opt/dell/barclamps"
  barclamp_name = "cb#{cluster_name}"

  output += check_configuration_cluster_allocate(cluster_name, barclamps_path, all_nodes, list_node)
  output += verify_committed_barclamps("vcluster_core", list_node)
  output += verify_committed_barclamps(barclamp_name, list_node)

  return output
end

#crowbar_configure_proposal(cluster_name, network_adress, mask, cpu_weight, ram, idvlan, description) ⇒ Object

Set the configuration of proposal .

Parameters:

  • cluster_name

    the name of cluster

  • network_adress

    is network adress

  • mask

    is the cidr of network adress

  • idvlan

    the value of VLANID

  • cpu_weight

    is the weight of cpu

  • ram

    is the weight of ram memory

  • description

    is description of cluster

Returns:

  • Boolean true is successful and false if error

Author:

  • mbretaud



385
386
387
388
# File 'lib/receiver/crowbar_receiver.rb', line 385

def crowbar_configure_proposal(cluster_name, network_adress, mask, cpu_weight, ram, idvlan, description)
  @logger.info("Receiver::CrowbarReceiver   Configure the proposal for the cluster '#{cluster_name}'...")
  return @rest_connector.configure_proposal(cluster_name, network_adress, mask, idvlan, cpu_weight, ram, description)
end

#crowbar_create_cluster(cluster_name, network_address, mask, cpu_weight, ram, vlan_id, description) ⇒ Object

Create a vcluster

Parameters:

  • cluster_name

    The name of the vcluster

  • network_address

    The network address

  • mask

    The mask address

  • vlan_id

    The id of the vlan

  • cpu_weight

    The cpu weight

  • ram

    The ram capacity

  • description

    The description of the barclamp, it role

Raises:

  • (ArgumentError)

    if the name of the cluster and/or the address of network are not correct.

Author:

  • mbretaud



304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
# File 'lib/receiver/crowbar_receiver.rb', line 304

def crowbar_create_cluster(cluster_name, network_address, mask, cpu_weight, ram, vlan_id, description)
  @logger.info("Receiver::CrowbarReceiver   Create the vcluster '#{cluster_name}'...")

  output = ""
  barclamps_path = "/opt/dell/barclamps"
  proposal_name = "default"

  if is_ambari_proposal_exists("default")
    if check_cluster_name(cluster_name, proposal_name)
      vlan_id = check_vlan_id(vlan_id, cluster_name, barclamps_path, proposal_name)

      if check_network_address(network_address, barclamps_path, proposal_name)
        output += @shell_connector.copy_barclamp("/opt/dell/barclamps/vcluster", "/opt/dell/barclamps/cb#{cluster_name}", cluster_name, network_address, mask, vlan_id, cpu_weight, ram, description, "")
        output += @shell_connector.reload_service("cb#{cluster_name}")
        output += crowbar_create_proposal(cluster_name)
        crowbar_remove_node_proposal(cluster_name)
      else
        raise ArgumentError.new("The name of the cluster '#{cluster_name}' and/or the address of network '#{network_address}' are not correct.")
      end
    end
  end

  return output
end

#crowbar_create_proposal(cluster_name) ⇒ Object

create proposal for a barclamp

Parameters:

  • cluster_name

    The name of barclamp

Returns:

  • boolean true is successful and false if error

Author:

  • mbretaud



368
369
370
371
372
# File 'lib/receiver/crowbar_receiver.rb', line 368

def crowbar_create_proposal(cluster_name)
  @logger.info("Receiver::CrowbarReceiver   Create proposal for the barclamp cb#{cluster_name}...")
  barclamp_name = "cb#{cluster_name}"
  return @shell_connector.create_proposal(barclamp_name)
end

#crowbar_erase_node_hard_disk(node_name) ⇒ Object

Erase all data into all hard disks on the node and unmount partitions of /dev.

Parameters:

  • node_name

    The name of the node

Returns:

  • out The output displays

Author:

  • mbretaud



464
465
466
467
# File 'lib/receiver/crowbar_receiver.rb', line 464

def crowbar_erase_node_hard_disk(node_name)
  @logger.info("Receiver::CrowbarReceiver   Erase all data into all hard disks on the node '#{node_name}' and unmount partitions of /dev...")
  return @shell_connector.erase_node_hard_disk(node_name)
end

#crowbar_erase_node_server(node_name) ⇒ Object

Erase a node in the server Crowbar

Parameters:

  • node_name

    The name of the node

Author:

  • mbretaud



473
474
475
476
# File 'lib/receiver/crowbar_receiver.rb', line 473

def crowbar_erase_node_server(node_name)
  @logger.info("Receiver::CrowbarReceiver   Erase the node '#{node_name}' in the server Crowbar")
  return @shell_connector.erase_node_server(node_name)
end

#crowbar_get_barclamps_listJSON

Get a list of barclamps

Returns:

  • (JSON)

    list The list of barclamps

Author:

  • mbretaud



358
359
360
361
# File 'lib/receiver/crowbar_receiver.rb', line 358

def crowbar_get_barclamps_list()
  @logger.info("Receiver::CrowbarReceiver   Get the list of barclamps...")
  return @rest_connector.get_barclamps_list()
end

#crowbar_node_delete(node_name) ⇒ Object

remove node of the crowbar admin

Parameters:

  • node_name

    the name of node

Returns:

  • Boolean true is successful and false if error

Author:

  • mbretaud

  • mbretaud



396
397
398
399
# File 'lib/receiver/crowbar_receiver.rb', line 396

def crowbar_node_delete(node_name)
  @logger.info("Receiver::CrowbarReceiver   Remove node '#{node_name}' of the crowbar admin...")
  return @shell_connector.node_delete(node_name)
end

#crowbar_node_delete_proposal(node_name) ⇒ Object

Delete node in the proposal

Parameters:

  • node_name

    the name of node

Returns:

  • Boolean true is successful and false if error

Author:

  • mbretaud



406
407
408
409
# File 'lib/receiver/crowbar_receiver.rb', line 406

def crowbar_node_delete_proposal(node_name)
  @logger.info("Receiver::CrowbarReceiver   Delete the node '#{node_name}' in all proposals...")
  return @rest_connector.delete_node_proposal(node_name)
end

#crowbar_node_info(node_name) ⇒ Object

display a information of node

Parameters:

  • node_name

    the name of node

Returns:

  • Boolean true is successful and false if error

Author:

  • mbretaud



416
417
418
419
# File 'lib/receiver/crowbar_receiver.rb', line 416

def crowbar_node_info(node_name)
  @logger.info("Receiver::CrowbarReceiver   Display informations about the node '#{node_name}'...")
  return @shell_connector.node_info(node_name)
end

#crowbar_node_install(node_name) ⇒ Object

Install a node with crowbar

Parameters:

  • node_name

    the name of node

Returns:

  • Boolean true is successful and false if error

Author:

  • mbretaud



426
427
428
429
# File 'lib/receiver/crowbar_receiver.rb', line 426

def crowbar_node_install(node_name)
  @logger.info("Receiver::CrowbarReceiver   Install the node '#{node_name}' with crowbar...")
  return @shell_connector.node_install(node_name)
end

#crowbar_node_list_nodes(status = nil) ⇒ Object

display a list of node accord to a status #return List the list of node

Parameters:

  • status (defaults to: nil)

    the status of node

Author:

  • mbretaud



436
437
438
439
# File 'lib/receiver/crowbar_receiver.rb', line 436

def crowbar_node_list_nodes(status = nil)
  @logger.info("Receiver::CrowbarReceiver   Call the connector with the function 'node_list_nodes(#{status})'")
  return @shell_connector.node_list_nodes(status)
end

#crowbar_node_reinstall(node_name) ⇒ Object

Reinstall a node with crowbar

Parameters:

  • node_name

    the name of node

Returns:

  • Boolean true is successful and false if error

Author:

  • mbretaud



454
455
456
457
# File 'lib/receiver/crowbar_receiver.rb', line 454

def crowbar_node_reinstall(node_name)
  @logger.info("Receiver::CrowbarReceiver   Reinstall the node '#{node_name}' with crowbar...")
  return @shell_connector.node_reinstall(node_name)
end

#crowbar_reboot_node(node_name) ⇒ Object

reboot node with crowbar shell

Parameters:

  • node_name

    the name of node

Returns:

  • Output of crowbar command

Author:

  • mbretaud



483
484
485
486
# File 'lib/receiver/crowbar_receiver.rb', line 483

def crowbar_reboot_node(node_name)
  @logger.info("Receiver::CrowbarReceiver   Reboot the node '#{node_name}' with crowbar command...")
  return @shell_connector.reboot_node(node_name)
end

#crowbar_remove_node_proposal(cluster_name) ⇒ Object

Remove node in proposal’s barclamp

Parameters:

  • cluster_name

    the name of barclamp

Returns:

  • boolean true is successful and false if error

Author:

  • mbretaud



444
445
446
447
# File 'lib/receiver/crowbar_receiver.rb', line 444

def crowbar_remove_node_proposal(cluster_name)
  @logger.info("Receiver::CrowbarReceiver   Remove node in the proposal of the barclamp 'cb#{cluster_name}'...")
  @rest_connector.remove_nodes(cluster_name)
end

#crowbar_set_bios(node_name, bios_name) ⇒ Object

set bios name of node

Parameters:

  • node_name

    the name of node

  • bios_name

    the name of bios

Returns:

  • true is successful and false if error

Author:

  • mbretaud



517
518
519
520
# File 'lib/receiver/crowbar_receiver.rb', line 517

def crowbar_set_bios(node_name, bios_name)
  @logger.info("Receiver::CrowbarReceiver   Set bios name of node '#{node_name}'...")
  return @rest_connector.set_bios(node_name, bios_name)
end

#crowbar_set_bios_raid(node_name, bios_name, raid_name) ⇒ Object

set raid JbodOnly or Raid10 and set bios on node

Parameters:

  • node_name

    the name of node

  • bios_name

    the name of bios

  • raid_name

    type of raid JbodOnly or Raid10

Returns:

  • true is successful and false if error

Author:

  • mbretaud



540
541
542
543
# File 'lib/receiver/crowbar_receiver.rb', line 540

def crowbar_set_bios_raid(node_name, bios_name, raid_name)
  @logger.info("Receiver::CrowbarReceiver   Set raid  JbodOnly or Raid10 and set bios on node '#{node_name}'...")
  return @rest_connector.set_bios_raid(node_name, bios_name, raid_name)
end

#crowbar_set_raid(node_name, raid_name) ⇒ Object

set raid of node JbodOnly or Raid10

Parameters:

  • node_name

    the name of node

  • raid_name

    the name of raid JbodOnly or Raid10

Returns:

  • true is successful and false if error

Author:

  • mbretaud



528
529
530
531
# File 'lib/receiver/crowbar_receiver.rb', line 528

def crowbar_set_raid(node_name, raid_name)
  @logger.info("Receiver::CrowbarReceiver   Set raid  of node '#{node_name}' JbodOnly or Raid10...")
  return @rest_connector.set_raid(node_name, raid_name)
end

#crowbar_vcluster_delete(cluster_name) ⇒ Object

Delete a vcluster

Parameters:

  • cluster_name

    The name of the vlcuster

Author:

  • mbretaud



549
550
551
552
# File 'lib/receiver/crowbar_receiver.rb', line 549

def crowbar_vcluster_delete(cluster_name)
  @logger.info("Receiver::CrowbarReceiver   Delete the vcluster '#{cluster_name}'...")
  return @rest_connector.vcluster_delete(cluster_name)
end

#crowbar_vcluster_info(cluster_name, proposal_name) ⇒ Object

Get the informations about the vcluster

Parameters:

  • cluster_name

    The name of the vlcuster

  • proposal_name

    The name of the proposal

Returns:

  • The informations about the vcluster

Raises:

  • Error Execute the shell command

Author:

  • mbretaud



561
562
563
564
# File 'lib/receiver/crowbar_receiver.rb', line 561

def crowbar_vcluster_info(cluster_name, proposal_name)
  @logger.info("Receiver::CrowbarReceiver   Get the informations about the vcluster '#{cluster_name}'...")
  return @shell_connector.vcluster_info(cluster_name, proposal_name)
end

#crowbar_vcluster_ls(cluster_name, proposal_name) ⇒ Object

Displays a list of vclusters

Parameters:

  • cluster_name

    The name of the vlcuster

  • proposal_name

    The name of the proposal

Returns:

  • info_vcluster The informations about the vcluster

Raises:

  • Error Execute the shell command

Author:

  • mbretaud



573
574
575
576
# File 'lib/receiver/crowbar_receiver.rb', line 573

def crowbar_vcluster_ls(cluster_name, proposal_name)
  @logger.info("Receiver::CrowbarReceiver   Displays a list of vclusters...")
  return @shell_connector.vcluster_ls(cluster_name, proposal_name)
end

#is_ambari_proposal_exists(proposal) ⇒ Boolean

Check if the ambari proposal exists or not

Returns:

  • (Boolean)

    if true the ambari proposal exists.

Raises:

Author:

  • mbretaud



334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
# File 'lib/receiver/crowbar_receiver.rb', line 334

def is_ambari_proposal_exists(proposal)
  p = crowbar_get_barclamps_list()

  proposal_exists = false
  if p['i18n'] != nil
    get_keys = p['i18n'].keys
    get_keys.each{|e|
      if e.include? "ambari_"
        proposal_exists = true
      end
    }
  end

  if !proposal_exists
    raise Common::VerifyBarclampError.new("The proposal '#{proposal}' is not created on the barclamp 'Ambari'.")
  else
    return true
  end
end

#reload_service(cluster_name) ⇒ Object

install a barclamp to th server crowbar

Parameters:

  • cluster_name

    the name of barclamp

Returns:

  • the output of crowbar’s command

Author:

  • mbretaud



582
583
584
585
586
# File 'lib/receiver/crowbar_receiver.rb', line 582

def reload_service(cluster_name)
  @logger.info("Receiver::CrowbarReceiver   Install the barclamp 'cb#{cluster_name}' to the server crowbar...")
  barclamp_name="cb#{cluster_name}"
  return @shell_connector.reload_service(barclamp_name)
end

#set_cluster_machine(cluster_name, liste_nodes) ⇒ Object

Set the list of nodes to the proposal.

Parameters:

  • cluster_name

    name the name of cluster

  • liste_nodes

    the List of node

Returns:

  • Boolean true is successful and false if error

Author:

  • mbretaud



505
506
507
508
509
# File 'lib/receiver/crowbar_receiver.rb', line 505

def set_cluster_machine(cluster_name , liste_nodes)
  @logger.info("Receiver::CrowbarReceiver   Set the list of nodes to the proposal...")
  barclamp_name = "cb#{cluster_name}"
  return @shell_connector.set_cluster_machine(cluster_name, barclamp_name, liste_nodes)
end

#verify_committed_barclamps(barclamp_name, list_node) ⇒ Object

Verify a barclamp is commited with a good node

Parameters:

  • barclamp_name

    the name of barclamp

  • list_node

    the list of node

Returns:

  • true is successful and false if error

Author:

  • mbretaud



494
495
496
497
# File 'lib/receiver/crowbar_receiver.rb', line 494

def verify_committed_barclamps(barclamp_name,list_node)
  @logger.info("Receiver::CrowbarReceiver   Verify barclamp '#{barclamp_name}' is commited with a good node...")
  return @rest_connector.verify_committed_barclamp(barclamp_name,list_node)
end