-
Notifications
You must be signed in to change notification settings - Fork 302
fleetctl: print out result message explicitly #1577
fleetctl: print out result message explicitly #1577
Conversation
1986e53
to
b06808e
Compare
Updated, to print friendly messages for both stop and unload. |
@@ -85,6 +85,11 @@ func runStopUnit(args []string) (exit int) { | |||
} | |||
|
|||
exit = tryWaitForUnitStates(stopping, "stop", job.JobStateLoaded, getBlockAttempts(), os.Stdout) | |||
if exit == 0 { | |||
stdout("Successfully stopped units %v.", stopping) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this to stdout and not stderr? stdout is basically part of the contract of the output (i.e. this would become API)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
Merged #1577. Thanks. |
if exit == 0 { | ||
stderr("Successfully stopped units %v.", stopping) | ||
} else { | ||
stderr("Failed to stop units %v. exit == %d.", stopping, exit) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
Fleetctl stop
orunload
has 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