Class: Chef::Knife::RoleTarUpload

Inherits:
Chef::Knife show all
Defined in:
lib/chef/knife/role_tar_upload.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.upload_roles(tar_file) ⇒ Object



27
28
29
30
31
32
# File 'lib/chef/knife/role_tar_upload.rb', line 27

def self.upload_roles tar_file
  role_from_file = Chef::Knife::RoleFromFile.new 
  role_from_file.name_args = tar_file.roles
  role_from_file.config[:print_after] = true
  role_from_file.run
end

Instance Method Details

#runObject



14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/chef/knife/role_tar_upload.rb', line 14

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[0])
  RoleTarUpload.upload_roles tar_file
  
end