class Kitchen::Provisioner::Base
Public Instance Methods
call(state)
click to toggle source
ChefZeroNodes
needs to access to provision of the instance without invoking the behavior of Base#call
because we need to add additional command after chef_client run complete.
@param state [Hash] mutable instance state @raise [ActionFailed] if the action could not be completed
# File lib/kitchen/provisioner/chef_zero_nodes.rb, line 126 def call(state) create_sandbox sandbox_dirs = Dir.glob(File.join(sandbox_path, '*')) instance.transport.connection(state) do |conn| conn.execute(install_command) conn.execute(init_command) info("Transferring files to #{instance.to_str}") conn.upload(sandbox_dirs, config[:root_path]) debug('Transfer complete') conn.execute(prepare_command) conn.execute(run_command) # Download node json object generated by chef_client int_node_file = windows_os? ? win_int_node_file : unix_int_node_file info("Change permissions for #{int_node_file}") conn.execute("sudo chmod +r #{int_node_file}") info("Transferring #{int_node_file} " \ "from instance to #{ext_node_file}") conn.download(int_node_file, ext_node_file) debug('Transfer complete') end rescue Kitchen::Transport::TransportFailed => ex raise ActionFailed, ex.message ensure cleanup_sandbox end