diff --git a/index.html b/index.html index 5638099..948a1d1 100644 --- a/index.html +++ b/index.html @@ -71,7 +71,7 @@ - + @@ -79,7 +79,7 @@ - + @@ -671,8 +671,6 @@
package fleetctl import ( - "fmt" - "github.com/heathcliff26/fleetlock/pkg/client" systemdutils "github.com/heathcliff26/fleetlock/pkg/systemd-utils" "github.com/spf13/cobra" @@ -685,22 +683,22 @@ cmd := &cobra.Command{ Use: "id", Short: "display this node zincati app id", - RunE: func(cmd *cobra.Command, _ []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { input, err := cmd.Flags().GetString(flagNameMachineID) if err != nil { return err } - var id string - if input == "" { + var id string + if input == "" { id, err = client.GetZincateAppID() - } else { + } else { id, err = systemdutils.ZincatiMachineID(input) } - if err != nil { + if err != nil { exitError(cmd, err) } - fmt.Println(id) + cmd.Println(id) return nil }, @@ -714,8 +712,6 @@@@ -3255,7 +3249,6 @@package fleetctl import ( - "fmt" - "github.com/spf13/cobra" ) @@ -736,7 +732,7 @@ exitError(cmd, err) }- fmt.Println("Success") + cmd.Println("Success") return nil }, } @@ -749,8 +745,6 @@package fleetctl import ( - "fmt" - "github.com/spf13/cobra" ) @@ -771,7 +765,7 @@ exitError(cmd, err) }- fmt.Println("Success") + cmd.Println("Success") return nil }, } @@ -845,38 +839,38 @@ } // Takes care if parsing the arguments and creating a client from them -func getClientFromCMD(cmd *cobra.Command, args []string) (*client.FleetlockClient, error) { +func getClientFromCMD(cmd *cobra.Command, args []string) (*client.FleetlockClient, error) { group, err := cmd.Flags().GetString(flagNameGroup) if err != nil { return nil, err } - id, err := cmd.Flags().GetString(flagNameID) + id, err := cmd.Flags().GetString(flagNameID) if err != nil { return nil, err } - if len(args) < 1 { + if len(args) < 1 { return nil, fmt.Errorf("missing url") } - c, err := client.NewClient(args[0], group) + c, err := client.NewClient(args[0], group) if err != nil { return nil, err } - if id != "" { + if id != "" { err = c.SetID(id) if err != nil { return nil, err } } - return c, nil + return c, nil } // Print the error information on stderr and exit with code 1 func exitError(cmd *cobra.Command, err error) { - fmt.Fprintln(cmd.Root().ErrOrStderr(), "Fatal: "+err.Error()) + cmd.PrintErrln("Fatal: " + err.Error()) os.Exit(1) }
package version
import (
- "fmt"
"runtime"
"runtime/debug"
@@ -3270,7 +3263,7 @@
Use: "version",
Short: "Print version information and exit",
Run: func(cmd *cobra.Command, args []string) {
- fmt.Print(VersionInfoString(name))
+ cmd.Print(VersionInfoString(name))
},
}
// Override to prevent parent function from running