From 31db6e5a21afb62183ea6721fd79d515fc9b77b9 Mon Sep 17 00:00:00 2001
From: Link Dupont
Date: Wed, 30 Jun 2021 12:36:17 -0400
Subject: [PATCH 1/2] fix: Improve output during 'disconnect'
Now print the status of the disconnection process, including the results afterwards.
Fixes ESSNTL-837
Signed-off-by: Link Dupont
---
cmd/ygg/main.go | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/cmd/ygg/main.go b/cmd/ygg/main.go
index 5226bce..f5c5c47 100644
--- a/cmd/ygg/main.go
+++ b/cmd/ygg/main.go
@@ -162,17 +162,21 @@ func main() {
fmt.Printf("Disconnecting %v from %v.\nThis might take a few seconds.\n\n", hostname, yggdrasil.Provider)
s := spinner.New(spinner.CharSets[9], 100*time.Millisecond)
- defer s.Stop()
- s.Suffix = " Disconnecting..."
+ s.Suffix = fmt.Sprintf(" Deactivating the %v daemon", yggdrasil.BrandName)
s.Start()
if err := deactivate(); err != nil {
return cli.Exit(err, 1)
}
+ s.Stop()
+ fmt.Printf(failPrefix+" Deactivated the %v daemon\n", yggdrasil.BrandName)
+ s.Suffix = " Disconnecting from Red Hat Subscription Management..."
+ s.Start()
if err := unregister(); err != nil {
return cli.Exit(err, 1)
}
s.Stop()
+ fmt.Printf(failPrefix + " Disconnected from Red Hat Subscription Management\n")
fmt.Printf("\nManage your Red Hat connector systems: https://red.ht/connector\n")
--
2.31.1