class Chef::Knife::NodeTarUpload

Public Class Methods

upload_nodes(tar_file) click to toggle source
# File lib/chef/knife/node_tar_upload.rb, line 26
def self.upload_nodes(tar_file)
  node_from_file = Chef::Knife::NodeFromFile.new
  
  tar_file.nodes.each do |nodes_path|
    node_from_file.name_args = [nodes_path]
    node_from_file.run
  end
end

Public Instance Methods

run() click to toggle source
# File lib/chef/knife/node_tar_upload.rb, line 13
def run
  #Get Arguments
  if @name_args.size != 1
    ui.info("Please specify a tar path")
    show_usage
    exit 1
  end
  
  tar_file = Chef::TarFile.new(@name_args.first)
  NodeTarUpload.upload_nodes tar_file

end