Class: Kitchen::Provisioner::Dokken
- Inherits:
-
ChefZero
- Object
- ChefZero
- Kitchen::Provisioner::Dokken
- Defined in:
- lib/kitchen/provisioner/dokken.rb
Overview
Instance Method Summary collapse
Instance Method Details
#call(state) ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/kitchen/provisioner/dokken.rb', line 42 def call(state) create_sandbox instance.transport.connection(state) do |conn| if remote_docker_host? info("Transferring files to #{instance.to_str}") conn.upload(sandbox_dirs, config[:root_path]) end conn.execute(prepare_command) conn.execute_with_retry( run_command, config[:retry_on_exit_code], config[:max_retries], config[:wait_for_retry] ) end rescue Kitchen::Transport::TransportFailed => ex raise ActionFailed, ex. ensure cleanup_dokken_sandbox end |
#validate_config ⇒ Object
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/kitchen/provisioner/dokken.rb', line 64 def validate_config # check if we have an space for the user provided options # or add it if not to avoid issues unless config[:chef_options].start_with? ' ' config[:chef_options].prepend(' ') end # strip spaces from all other options config[:chef_binary] = config[:chef_binary].strip config[:chef_log_level] = config[:chef_log_level].strip config[:chef_output_format] = config[:chef_output_format].strip # if the user wants to be funny and pass empty strings # just use the defaults config[:chef_log_level] = 'warn' if config[:chef_log_level].empty? config[:chef_output_format] = 'doc' if config[:chef_output_format].empty? end |