lib/commands/node.rb in testlab-0.6.8 vs lib/commands/node.rb in testlab-0.6.9

- old
+ new

@@ -140,9 +140,32 @@ node.teardown end end end + # NODE BUILD + ############# + c.desc 'Build a node' + c.long_desc <<-EOF +Attempts to build up the node. TestLab will attempt to create, online and provision the node. + +The node is taken through the following phases: + +Create -> Up -> Setup +EOF + c.command :build do |build| + build.action do |global_options, options, args| + if options[:name].nil? + help_now!('a name is required') if options[:name].nil? + else + node = @testlab.nodes.select{ |c| c.id.to_sym == options[:name].to_sym }.first + node.nil? and raise TestLab::TestLabError, "We could not find the node you supplied!" + + node.build + end + end + end + # NODE STATUS ############## c.desc 'Display the status of node(s)' c.long_desc 'Displays the status of all nodes or a single node if supplied via the ID parameter.' c.command :status do |status|