Commit Graph

107 Commits

Author SHA1 Message Date
Karsten Weiss 4d6386e97b Use fmt.Errorf() (gosimple)
This fixes:
pkg/cmd/grafana-cli/commands/install_command.go:36:11: should use fmt.Errorf(...) instead of errors.New(fmt.Sprintf(...)) (S1028)
pkg/models/org_user.go:53:11: should use fmt.Errorf(...) instead of errors.New(fmt.Sprintf(...)) (S1028)
pkg/services/notifications/mailer.go:138:16: should use fmt.Errorf(...) instead of errors.New(fmt.Sprintf(...)) (S1028)
2018-04-16 21:04:57 +02:00
Karsten Weiss f61e69ce75 Simplify comparison to bool constant (gosimple)
This fixes:
build.go:553:6: should omit comparison to bool constant, can be simplified to !strings.Contains(path, ".sha256") (S1002)
pkg/cmd/grafana-cli/commands/ls_command.go:27:5: should omit comparison to bool constant, can be simplified to !pluginDirInfo.IsDir() (S1002)
pkg/components/dynmap/dynmap_test.go:24:5: should omit comparison to bool constant, can be simplified to !value (S1002)
pkg/components/dynmap/dynmap_test.go:122:14: should omit comparison to bool constant, can be simplified to b (S1002)
pkg/components/dynmap/dynmap_test.go:125:14: should omit comparison to bool constant, can be simplified to !b (S1002)
pkg/components/dynmap/dynmap_test.go:128:14: should omit comparison to bool constant, can be simplified to !b (S1002)
pkg/models/org_user.go:51:5: should omit comparison to bool constant, can be simplified to !(*r).IsValid() (S1002)
pkg/plugins/datasource/wrapper/datasource_plugin_wrapper_test.go:77:12: should omit comparison to bool constant, can be simplified to !haveBool (S1002)
pkg/services/alerting/conditions/evaluator.go:23:9: should omit comparison to bool constant, can be simplified to !reducedValue.Valid (S1002)
pkg/services/alerting/conditions/evaluator.go:48:5: should omit comparison to bool constant, can be simplified to !reducedValue.Valid (S1002)
pkg/services/alerting/conditions/evaluator.go:91:5: should omit comparison to bool constant, can be simplified to !reducedValue.Valid (S1002)
pkg/services/alerting/conditions/query.go:56:6: should omit comparison to bool constant, can be simplified to !reducedValue.Valid (S1002)
pkg/services/alerting/extractor.go:107:20: should omit comparison to bool constant, can be simplified to !enabled.MustBool() (S1002)
pkg/services/alerting/notifiers/telegram.go:222:41: should omit comparison to bool constant, can be simplified to this.UploadImage (S1002)
pkg/services/sqlstore/apikey.go:58:12: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/services/sqlstore/apikey.go:72:12: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/services/sqlstore/dashboard.go:66:33: should omit comparison to bool constant, can be simplified to !cmd.Overwrite (S1002)
pkg/services/sqlstore/dashboard.go:175:12: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/services/sqlstore/dashboard.go:311:13: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/services/sqlstore/dashboard.go:444:12: should omit comparison to bool constant, can be simplified to !exists (S1002)
pkg/services/sqlstore/dashboard.go:472:12: should omit comparison to bool constant, can be simplified to !exists (S1002)
pkg/services/sqlstore/dashboard.go:554:32: should omit comparison to bool constant, can be simplified to !cmd.Overwrite (S1002)
pkg/services/sqlstore/dashboard_snapshot.go:83:12: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/services/sqlstore/plugin_setting.go:39:12: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/services/sqlstore/quota.go:34:12: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/services/sqlstore/quota.go:111:6: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/services/sqlstore/quota.go:136:12: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/services/sqlstore/quota.go:213:6: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/services/sqlstore/temp_user.go:129:12: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/services/sqlstore/user.go:157:12: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/services/sqlstore/user.go:182:5: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/services/sqlstore/user.go:191:12: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/services/sqlstore/user.go:212:12: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/services/sqlstore/user.go:307:12: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/social/generic_oauth.go:185:5: should omit comparison to bool constant, can be simplified to !s.extractToken(&data, token) (S1002)
pkg/tsdb/mssql/mssql.go:148:39: should omit comparison to bool constant, can be simplified to ok (S1002)
pkg/tsdb/mssql/mssql.go:212:6: should omit comparison to bool constant, can be simplified to !query.Model.Get("fillNull").MustBool(false) (S1002)
pkg/tsdb/mssql/mssql.go:247:56: should omit comparison to bool constant, can be simplified to ok (S1002)
pkg/tsdb/mssql/mssql.go:274:7: should omit comparison to bool constant, can be simplified to !exist (S1002)
pkg/tsdb/mssql/mssql.go:282:8: should omit comparison to bool constant, can be simplified to !exist (S1002)
pkg/tsdb/mysql/mysql.go:221:6: should omit comparison to bool constant, can be simplified to !query.Model.Get("fillNull").MustBool(false) (S1002)
pkg/tsdb/mysql/mysql.go:256:56: should omit comparison to bool constant, can be simplified to ok (S1002)
pkg/tsdb/mysql/mysql.go:283:7: should omit comparison to bool constant, can be simplified to !exist (S1002)
pkg/tsdb/mysql/mysql.go:291:8: should omit comparison to bool constant, can be simplified to !exist (S1002)
pkg/tsdb/postgres/postgres.go:134:39: should omit comparison to bool constant, can be simplified to ok (S1002)
pkg/tsdb/postgres/postgres.go:201:6: should omit comparison to bool constant, can be simplified to !query.Model.Get("fillNull").MustBool(false) (S1002)
pkg/tsdb/postgres/postgres.go:236:56: should omit comparison to bool constant, can be simplified to ok (S1002)
pkg/tsdb/postgres/postgres.go:263:7: should omit comparison to bool constant, can be simplified to !exist (S1002)
pkg/tsdb/postgres/postgres.go:271:8: should omit comparison to bool constant, can be simplified to !exist (S1002)
2018-04-16 21:04:57 +02:00
Matthew McGinn ee623e2091 Grafana-CLI: mention the plugins directory is not writable on failure 2018-04-15 13:44:59 -04:00
bergquist b099f0309f cli: download latest dependency by default 2018-02-16 09:54:37 +01:00
bergquist 5bbe047eaa Revert "removes dependencies install for plugins"
This reverts commit 47e363ea15.
2018-02-16 09:49:29 +01:00
bergquist 47e363ea15 removes dependencies install for plugins
this features was never intended for production.
2018-02-14 15:40:42 +01:00
THIERRY SALLE e978bfc368 Added --pluginUrl option to grafana-cli for local network plugin installation 2017-09-15 20:34:08 +02:00
Daniel Lee 6ec1d16327 fix: cli admin reset-password fixes cmd args
Fixes the homepath and config command line args. This allows the
command to be used even when the homepath is different from the
default.

Fixes #7730
2017-04-20 13:30:17 +02:00
bergquist 96e8ecfa7b feat(cli): adds command to reset admin password
closes #5479
2016-12-09 15:25:02 +01:00
bergquist cd85e1f651 Merge branch 'master' into cli_db_commands 2016-12-09 12:36:05 +01:00
bergquist 3f00834f25 tech: remove unused dependencies 2016-09-19 15:21:53 +02:00
bergquist 3c966caa23 feat(cli): download all plugin dependencies 2016-09-15 14:38:11 +02:00
bergquist 645293e590 fix(cli): improve error message for upgrade-all
closes #5885
2016-08-30 13:47:42 +02:00
bergquist 5d821d3492 style(cli): minor fix 2016-08-24 20:27:41 +02:00
bergquist c087445d51 feat(cli): add db command to cli. 2016-08-24 15:46:26 +02:00
Mark Henderson 39be7cf7d7 Added grafana-cli command. Added public documentation for specifying plugin version when installing. (#5665) 2016-07-27 09:41:33 +02:00
bergquist af216ecf83 tech(cli): remove loop and head straight for plugindir 2016-06-26 03:47:15 +02:00
bergquist 07be2c89a3 tech(cli): lets use the fact that we have a compiler 2016-06-26 03:47:15 +02:00
bergquist 2123fbdf9b feat(cli): make remove command an alias for uninstall 2016-06-23 08:21:55 +02:00
bergquist 6de1399cf0 fix(cli): fixes broken import 2016-06-03 12:35:17 +02:00
bergquist 15aeb4aec2 tech(cli): rename log to logger to separate from server logger 2016-06-03 12:22:30 +02:00
Dan Cech 9f9f4e7fef use new plugin-specific repo route when installing or updating a single plugin (#4992) 2016-05-12 10:43:31 +02:00
bergquist 07b13e24fa style(cli): add some color to error messages 2016-04-23 14:39:42 +02:00
bergquist 0855f51436 feat(cli): improves defer error handling 2016-04-23 14:39:42 +02:00
bergquist 70acfb2cfd fix(cli): adds better help text.
The zip lib is throwing panics sometimes when the response is malformed.
The cli will now try to download the zip file up to three times before
aborting. The cli gives a better error message and informes the user
about retrying.

closes #4651
2016-04-23 14:39:42 +02:00
bergquist ff22f43002 fix(cli): fixes missplaced % 2016-04-19 14:46:03 +02:00
bergquist d38d4efc18 style(cli): improve logging to find install crash 2016-04-19 10:39:55 +02:00
bergquist a8c68e33db feat(cli): add more logging for failed install 2016-04-19 10:22:02 +02:00
bergquist 903d1b7797 tech(cli): dont use defer statements in loops 2016-04-19 09:13:58 +02:00
bergquist 5abaf26b5f style(cli): remove some logging 2016-04-19 08:39:22 +02:00
Torkel Ödegaard f93b039e42 change(grafana-cli): changed upgrade to update in command line, upgrade and upgrade-all will still work as aliases 2016-04-11 18:05:28 -04:00
bergquist eeb7524c0f feat(cli): improve helptext for cli 2016-04-11 14:50:34 +02:00
bergquist 2fd25f0093 feat(cli): add uninstall alias for remove 2016-04-11 14:49:12 +02:00
bergquist 676e950fa3 fix(cli): improve error message for not using sudo
closes #4562
2016-04-05 15:37:09 +02:00
Torkel Ödegaard 1e44ee9e9b feat(grafana-cli): minor changes 2016-03-28 21:42:26 +02:00
bergquist 7f8643efde feat(cli): make all plugin commands subcommands 2016-03-21 10:01:07 +01:00
bergquist 1a11f1e8c6 Merge branch 'master' into cli_colors 2016-03-16 14:17:35 +01:00
bergquist a12f5376b5 feat(cli): adds some colors to ls command 2016-03-16 14:09:30 +01:00
bergquist 8e70e9c1c3 feat(cli): improve error message for missing permission 2016-03-13 11:29:43 +01:00
bergquist 740478344b Merge branch 'master' into cli_colors 2016-03-11 14:43:12 +01:00
bergquist f5bb2b11e5 feat(cli): improve error handling for missing plugin dir 2016-03-11 14:11:25 +01:00
bergquist 95de5f6fe1 feat(cli): adds some amazing colors 2016-03-10 17:33:44 +01:00
bergquist 788aafff3c feat(cli): disable dependecy downloads until needed 2016-03-10 17:16:01 +01:00
bergquist fee0745e98 feat(cli): support for asking grafana net about plugins 2016-03-10 16:25:34 +01:00
bergquist 95f3e52064 feat(cli): use commandline object all the way 2016-03-08 14:54:18 +01:00
bergquist 2fcb8b849e style(cli): fixed typos 2016-03-08 14:30:25 +01:00
bergquist d7a72e30c0 gofmt 2016-03-08 13:29:42 +01:00
bergquist f397d0ddd7 fix(cli): retry download when panicing
Will retry to download plugins once if the zip lib panics.

closes #4068
2016-03-08 13:16:58 +01:00
bergquist 1a6af064b0 fix(cli): improve logging when folders does not exists 2016-03-07 16:41:22 +01:00
bergquist 7ef62d28a5 feat(cli): add logging to catch panics 2016-03-07 16:11:28 +01:00