# HG changeset patch # User Mikael Berthe # Date 1547379204 -3600 # Node ID a01bc98ae01a05f0c4c7ea4d877ad7917efa6f40 # Parent 1bec7d3d6a859bf55470b8b847e2862a37aed1c5 Display config details after oauth2 After a new oauth2 authorization, the configuration details are displayed even when the 'safe_mode' option is set. diff -r 1bec7d3d6a85 -r a01bc98ae01a cmd/config.go --- a/cmd/config.go Sun Jan 13 12:28:07 2019 +0100 +++ b/cmd/config.go Sun Jan 13 12:33:24 2019 +0100 @@ -43,7 +43,7 @@ Short: "Dump the configuration", Example: ` madonctl config dump -i INSTANCE -L USERNAME -P PASS > config.yaml`, RunE: func(cmd *cobra.Command, args []string) error { - return configDump() + return configDump(false) }, }, &cobra.Command{ @@ -84,8 +84,8 @@ ... ` -func configDump() error { - if viper.GetBool("safe_mode") { +func configDump(force bool) error { + if !force && viper.GetBool("safe_mode") { errPrint("Cannot dump: disabled by configuration (safe_mode)") return nil } diff -r 1bec7d3d6a85 -r a01bc98ae01a cmd/oauth2.go --- a/cmd/oauth2.go Sun Jan 13 12:28:07 2019 +0100 +++ b/cmd/oauth2.go Sun Jan 13 12:33:24 2019 +0100 @@ -88,7 +88,7 @@ if gClient.UserToken != nil { errPrint("Login successful.\n") - configDump() + configDump(true) } return nil }