From db26e1ef947188bd4d5716ed7712171306ff7f66 Mon Sep 17 00:00:00 2001 From: Valentin Rothberg Date: Wed, 23 Jun 2021 11:31:21 +0200 Subject: auto-update: make restarted unit more obvious The output of auto-update leaves quite some space for improvements. One thing is to make it more obvious which systemd units were restarted. With this change, the output looks as follows: ``` $ podman auto-update Trying to pull... Restarted the following systemd units: $unit-1 $unit-2 $unit-3 ``` Signed-off-by: Valentin Rothberg --- cmd/podman/auto-update.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'cmd/podman') diff --git a/cmd/podman/auto-update.go b/cmd/podman/auto-update.go index 99226790f..34cc7d74b 100644 --- a/cmd/podman/auto-update.go +++ b/cmd/podman/auto-update.go @@ -50,7 +50,9 @@ func autoUpdate(cmd *cobra.Command, args []string) error { return errors.Errorf("`%s` takes no arguments", cmd.CommandPath()) } report, failures := registry.ContainerEngine().AutoUpdate(registry.GetContext(), autoUpdateOptions) - if report != nil { + if report != nil && len(report.Units) > 0 { + // Make it more obvious to users what the output means. + fmt.Println("\nRestarted the following systemd units:") for _, unit := range report.Units { fmt.Println(unit) } -- cgit v1.2.3-54-g00ecf