lib/kitchen/verifier/shell.rb in kitchen-verifier-shell-0.1.1 vs lib/kitchen/verifier/shell.rb in kitchen-verifier-shell-0.2.0
- old
+ new
@@ -34,17 +34,34 @@
default_config :sleep, 0
default_config :command, "true"
default_config :shellout_opts, {}
default_config :live_stream, $stdout
+ default_config :remote_exec, false
# (see Base#call)
def call(state)
info("[#{name}] Verify on instance=#{instance} with state=#{state}")
sleep_if_set
merge_state_to_env(state)
- shellout
+ if config[:remote_exec]
+ instance.transport.connection(state) do |conn|
+ conn.execute(config[:command])
+ end
+ else
+ shellout
+ end
debug("[#{name}] Verify completed.")
+ end
+
+ ## for legacy drivers.
+ def run_command
+ if config[:remote_exec]
+ config[:command]
+ else
+ shellout
+ nil
+ end
end
private
# Sleep for a period of time, if a value is set in the config.