This repository was archived by the owner on Jan 30, 2020. It is now read-only.
fleetctl: print out result message explicitly#1577
Merged
dongsupark merged 1 commit intocoreos:masterfrom May 20, 2016
Merged
Conversation
1986e53 to
b06808e
Compare
Author
|
Updated, to print friendly messages for both stop and unload. |
fleetctl/stop.go
Outdated
|
|
||
| exit = tryWaitForUnitStates(stopping, "stop", job.JobStateLoaded, getBlockAttempts(), os.Stdout) | ||
| if exit == 0 { | ||
| stdout("Successfully stopped units %v.", stopping) |
Contributor
There was a problem hiding this comment.
Why is this to stdout and not stderr? stdout is basically part of the contract of the output (i.e. this would become API)
Author
There was a problem hiding this comment.
Done, changed from stdout to stderr.
Fleetctl {stop,unload} has been always printing out somewhat ambiguous
messages like below:
Unit app.service loaded on 0eb1b9b6.../coreos1
For better usability, print out a better result message, either about
{stopp,unload}ing successfully, or failing to do.
Partially resolves: coreos#1432
b06808e to
2dbfa32
Compare
Author
|
Merged #1577. Thanks. |
| if exit == 0 { | ||
| stderr("Successfully stopped units %v.", stopping) | ||
| } else { | ||
| stderr("Failed to stop units %v. exit == %d.", stopping, exit) |
Contributor
There was a problem hiding this comment.
My apologies for missing this previously. Why do we print the return value here? We already exit the process with that value so it can be easily inspected. Could you remove that from the string, please?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fleetctl stoporunloadhas been always printing out somewhat ambiguous messages like below:For better usability, print out a better result message, either about stopping (or unloading) successfully, or failing to do.
Partially resolves: #1432
/cc @kayrus @tixxdz