Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

fleetctl: print out result message explicitly #1577

Merged

Conversation

dongsupark
Copy link
Contributor

@dongsupark dongsupark commented May 2, 2016

Fleetctl stop or 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 stopping (or unloading) successfully, or failing to do.

Partially resolves: #1432

/cc @kayrus @tixxdz

@dongsupark dongsupark force-pushed the dongsu/fleetctl-stop-final-message branch from 1986e53 to b06808e Compare May 4, 2016 10:28
@dongsupark
Copy link
Contributor Author

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)
Copy link
Contributor

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)

Copy link
Contributor Author

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
@dongsupark dongsupark force-pushed the dongsu/fleetctl-stop-final-message branch from b06808e to 2dbfa32 Compare May 18, 2016 14:28
@dongsupark dongsupark merged commit 6a92833 into coreos:master May 20, 2016
@dongsupark
Copy link
Contributor Author

Merged #1577. Thanks.

@dongsupark dongsupark deleted the dongsu/fleetctl-stop-final-message branch May 20, 2016 08:24
if exit == 0 {
stderr("Successfully stopped units %v.", stopping)
} else {
stderr("Failed to stop units %v. exit == %d.", stopping, exit)
Copy link
Contributor

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?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fleetctl: stop command doesn't show correct message
2 participants