diff --git a/cmd/dbaas_user_create.go b/cmd/dbaas_user_create.go index ed6f0035..692befdb 100644 --- a/cmd/dbaas_user_create.go +++ b/cmd/dbaas_user_create.go @@ -33,7 +33,7 @@ func (c *dbaasUserCreateCmd) cmdAliases() []string { return nil } func (c *dbaasUserCreateCmd) cmdShort() string { return "Create DBAAS user" } func (c *dbaasUserCreateCmd) cmdLong() string { - return fmt.Sprintf(`This command creates a DBAAS user for the specified service.`) + return fmt.Sprint(`This command creates a DBAAS user for the specified service.`) } func (c *dbaasUserCreateCmd) cmdPreRun(cmd *cobra.Command, args []string) error { @@ -71,9 +71,10 @@ func (c *dbaasUserCreateCmd) cmdRun(cmd *cobra.Command, args []string) error { return c.createOpensearch(cmd, args) case "redis": return c.createRedis(cmd, args) + default: + return fmt.Errorf("creating user unsupported for service of type %q", dbType) } - return nil } func init() { diff --git a/cmd/dbaas_user_delete.go b/cmd/dbaas_user_delete.go index 9801df0e..997b124b 100644 --- a/cmd/dbaas_user_delete.go +++ b/cmd/dbaas_user_delete.go @@ -25,7 +25,7 @@ func (c *dbaasUserDeleteCmd) cmdAliases() []string { return nil } func (c *dbaasUserDeleteCmd) cmdShort() string { return "Delete DBAAS user" } func (c *dbaasUserDeleteCmd) cmdLong() string { - return fmt.Sprintf(`This command deletes a DBAAS user for the specified service.`) + return fmt.Sprint(`This command deletes a DBAAS user for the specified service.`) } func (c *dbaasUserDeleteCmd) cmdPreRun(cmd *cobra.Command, args []string) error { @@ -52,9 +52,10 @@ func (c *dbaasUserDeleteCmd) cmdRun(cmd *cobra.Command, args []string) error { return c.deleteOpensearch(cmd, args) case "redis": return c.deleteRedis(cmd, args) + default: + return fmt.Errorf("deleting user unsupported for service of type %q", dbType) } - return nil } func init() { diff --git a/cmd/dbaas_user_reset.go b/cmd/dbaas_user_reset.go index 6e2d5f15..2677a786 100644 --- a/cmd/dbaas_user_reset.go +++ b/cmd/dbaas_user_reset.go @@ -31,7 +31,7 @@ func (c *dbaasUserResetCmd) cmdAliases() []string { return nil } func (c *dbaasUserResetCmd) cmdShort() string { return "Reset the credentials of a DBAAS user" } func (c *dbaasUserResetCmd) cmdLong() string { - return fmt.Sprintf(`This command resets the credentials of a DBAAS user for the specified service.`) + return fmt.Sprint(`This command resets the credentials of a DBAAS user for the specified service.`) } func (c *dbaasUserResetCmd) cmdPreRun(cmd *cobra.Command, args []string) error { @@ -68,9 +68,10 @@ func (c *dbaasUserResetCmd) cmdRun(cmd *cobra.Command, args []string) error { return c.resetRedis(cmd, args) case "grafana": return c.resetGrafana(cmd, args) + default: + return fmt.Errorf("reseting user credentials unsupported for service of type %q", dbType) } - return nil } func init() {