commands/docker-logs: exit status 1 if no logs were retrieved

This commit is contained in:
Mitchell Hashimoto 2014-04-15 17:42:22 -07:00
parent eab553ad55
commit 56f9fdac21
1 changed files with 8 additions and 2 deletions

View File

@ -30,8 +30,8 @@ module VagrantPlugins
argv = parse_options(opts)
return if !argv
# TODO: exit with exit status != 0 if all machines are unknown
# or not created.
# This keeps track of if we ran our action on any machines...
any_success = false
# Start a batch action that sends all the logs to stdout. This
# will parallelize, if enabled, across all containers that are
@ -52,11 +52,17 @@ module VagrantPlugins
next
end
# At least one was run!
any_success = true
batch.custom(machine) do |m|
execute_single(m, options)
end
end
end
# If we didn't run on any machines, then exit status 1
return any_success ? 0 : 1
end
protected