From b2e1d54dff5990d1d379ded419fe09ee5f892a8e Mon Sep 17 00:00:00 2001 From: Christopher Gallo Date: Fri, 1 Dec 2023 16:15:24 -0600 Subject: [PATCH 1/2] Removed --details from 'globalip unassign' as it did nothing --- plugin/commands/globalip/unassign.go | 2 -- plugin/commands/globalip/unassign_test.go | 14 ++++++-------- plugin/resources/i18n_resources.go | 20 ++++++++++---------- 3 files changed, 16 insertions(+), 20 deletions(-) diff --git a/plugin/commands/globalip/unassign.go b/plugin/commands/globalip/unassign.go index 3d3e492b..e547f1b6 100644 --- a/plugin/commands/globalip/unassign.go +++ b/plugin/commands/globalip/unassign.go @@ -13,7 +13,6 @@ type UnassignCommand struct { *metadata.SoftlayerCommand NetworkManager managers.NetworkManager Command *cobra.Command - Details bool } func NewUnassignCommand(sl *metadata.SoftlayerCommand) *UnassignCommand { @@ -29,7 +28,6 @@ func NewUnassignCommand(sl *metadata.SoftlayerCommand) *UnassignCommand { return thisCmd.Run(args) }, } - cobraCmd.Flags().BoolVar(&thisCmd.Details, "details", false, T("Shows a very detailed list of charges")) thisCmd.Command = cobraCmd return thisCmd } diff --git a/plugin/commands/globalip/unassign_test.go b/plugin/commands/globalip/unassign_test.go index a3237bc4..15f93502 100644 --- a/plugin/commands/globalip/unassign_test.go +++ b/plugin/commands/globalip/unassign_test.go @@ -2,9 +2,7 @@ package globalip_test import ( "errors" - "strings" - . "github.com/IBM-Cloud/ibm-cloud-cli-sdk/testhelpers/matchers" "github.com/IBM-Cloud/ibm-cloud-cli-sdk/testhelpers/terminal" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" @@ -37,14 +35,14 @@ var _ = Describe("GlobalIP unassign", func() { It("return error", func() { err := testhelpers.RunCobraCommand(cliCommand.Command) Expect(err).To(HaveOccurred()) - Expect(strings.Contains(err.Error(), "Incorrect Usage: This command requires one argument")).To(BeTrue()) + Expect(err.Error()).To(ContainSubstring("Incorrect Usage: This command requires one argument")) }) }) Context("GlobalIP unassign with wrong IP ID", func() { It("return error", func() { err := testhelpers.RunCobraCommand(cliCommand.Command, "abc") Expect(err).To(HaveOccurred()) - Expect(strings.Contains(err.Error(), "Invalid input for 'Globalip ID'. It must be a positive integer.")).To(BeTrue()) + Expect(err.Error()).To(ContainSubstring("Invalid input for 'Globalip ID'. It must be a positive integer.")) }) }) @@ -55,8 +53,8 @@ var _ = Describe("GlobalIP unassign", func() { It("return error", func() { err := testhelpers.RunCobraCommand(cliCommand.Command, "1234") Expect(err).To(HaveOccurred()) - Expect(strings.Contains(err.Error(), "Failed to unassign global IP 1234.")).To(BeTrue()) - Expect(strings.Contains(err.Error(), "Internal Server Error")).To(BeTrue()) + Expect(err.Error()).To(ContainSubstring("Failed to unassign global IP 1234.")) + Expect(err.Error()).To(ContainSubstring("Internal Server Error")) }) }) @@ -67,8 +65,8 @@ var _ = Describe("GlobalIP unassign", func() { It("return no error", func() { err := testhelpers.RunCobraCommand(cliCommand.Command, "1234") Expect(err).NotTo(HaveOccurred()) - Expect(fakeUI.Outputs()).To(ContainSubstrings([]string{"OK"})) - Expect(fakeUI.Outputs()).To(ContainSubstrings([]string{"The transaction to unroute a global IP address is created, routes will be updated in one or two minutes."})) + Expect(fakeUI.Outputs()).To(ContainSubstring("OK")) + Expect(fakeUI.Outputs()).To(ContainSubstring("The transaction to unroute a global IP address is created, routes will be updated in one or two minutes.")) }) }) }) diff --git a/plugin/resources/i18n_resources.go b/plugin/resources/i18n_resources.go index 1ef11312..6699f82f 100644 --- a/plugin/resources/i18n_resources.go +++ b/plugin/resources/i18n_resources.go @@ -92,7 +92,7 @@ func pluginI18nResourcesDe_deAllJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "plugin/i18n/resources/de_DE.all.json", size: 429732, mode: os.FileMode(438), modTime: time.Unix(1701463726, 0)} + info := bindataFileInfo{name: "plugin/i18n/resources/de_DE.all.json", size: 429732, mode: os.FileMode(438), modTime: time.Unix(1701468645, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -112,7 +112,7 @@ func pluginI18nResourcesEn_usAllJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "plugin/i18n/resources/en_US.all.json", size: 395999, mode: os.FileMode(438), modTime: time.Unix(1701463726, 0)} + info := bindataFileInfo{name: "plugin/i18n/resources/en_US.all.json", size: 395999, mode: os.FileMode(438), modTime: time.Unix(1701468645, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -132,7 +132,7 @@ func pluginI18nResourcesEs_esAllJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "plugin/i18n/resources/es_ES.all.json", size: 424563, mode: os.FileMode(438), modTime: time.Unix(1701463726, 0)} + info := bindataFileInfo{name: "plugin/i18n/resources/es_ES.all.json", size: 424563, mode: os.FileMode(438), modTime: time.Unix(1701468645, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -152,7 +152,7 @@ func pluginI18nResourcesFr_frAllJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "plugin/i18n/resources/fr_FR.all.json", size: 428810, mode: os.FileMode(438), modTime: time.Unix(1701463726, 0)} + info := bindataFileInfo{name: "plugin/i18n/resources/fr_FR.all.json", size: 428810, mode: os.FileMode(438), modTime: time.Unix(1701468645, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -172,7 +172,7 @@ func pluginI18nResourcesIt_itAllJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "plugin/i18n/resources/it_IT.all.json", size: 419594, mode: os.FileMode(438), modTime: time.Unix(1701463726, 0)} + info := bindataFileInfo{name: "plugin/i18n/resources/it_IT.all.json", size: 419594, mode: os.FileMode(438), modTime: time.Unix(1701468645, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -192,7 +192,7 @@ func pluginI18nResourcesJa_jpAllJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "plugin/i18n/resources/ja_JP.all.json", size: 462272, mode: os.FileMode(438), modTime: time.Unix(1701463726, 0)} + info := bindataFileInfo{name: "plugin/i18n/resources/ja_JP.all.json", size: 462272, mode: os.FileMode(438), modTime: time.Unix(1701468645, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -212,7 +212,7 @@ func pluginI18nResourcesKo_krAllJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "plugin/i18n/resources/ko_KR.all.json", size: 424966, mode: os.FileMode(438), modTime: time.Unix(1701463726, 0)} + info := bindataFileInfo{name: "plugin/i18n/resources/ko_KR.all.json", size: 424966, mode: os.FileMode(438), modTime: time.Unix(1701468645, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -232,7 +232,7 @@ func pluginI18nResourcesPt_brAllJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "plugin/i18n/resources/pt_BR.all.json", size: 417519, mode: os.FileMode(438), modTime: time.Unix(1701463726, 0)} + info := bindataFileInfo{name: "plugin/i18n/resources/pt_BR.all.json", size: 417519, mode: os.FileMode(438), modTime: time.Unix(1701468645, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -252,7 +252,7 @@ func pluginI18nResourcesZh_hansAllJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "plugin/i18n/resources/zh_Hans.all.json", size: 389271, mode: os.FileMode(438), modTime: time.Unix(1701463726, 0)} + info := bindataFileInfo{name: "plugin/i18n/resources/zh_Hans.all.json", size: 389271, mode: os.FileMode(438), modTime: time.Unix(1701468645, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -272,7 +272,7 @@ func pluginI18nResourcesZh_hantAllJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "plugin/i18n/resources/zh_Hant.all.json", size: 392417, mode: os.FileMode(438), modTime: time.Unix(1701463726, 0)} + info := bindataFileInfo{name: "plugin/i18n/resources/zh_Hant.all.json", size: 392417, mode: os.FileMode(438), modTime: time.Unix(1701468645, 0)} a := &asset{bytes: bytes, info: info} return a, nil } From 545da52e04591d81521c6af9f42d4dc5f66e8102 Mon Sep 17 00:00:00 2001 From: Christopher Gallo Date: Fri, 1 Dec 2023 16:19:49 -0600 Subject: [PATCH 2/2] reset changes to plugin/resources/i18n_resources.go --- plugin/resources/i18n_resources.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/plugin/resources/i18n_resources.go b/plugin/resources/i18n_resources.go index 6699f82f..1ef11312 100644 --- a/plugin/resources/i18n_resources.go +++ b/plugin/resources/i18n_resources.go @@ -92,7 +92,7 @@ func pluginI18nResourcesDe_deAllJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "plugin/i18n/resources/de_DE.all.json", size: 429732, mode: os.FileMode(438), modTime: time.Unix(1701468645, 0)} + info := bindataFileInfo{name: "plugin/i18n/resources/de_DE.all.json", size: 429732, mode: os.FileMode(438), modTime: time.Unix(1701463726, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -112,7 +112,7 @@ func pluginI18nResourcesEn_usAllJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "plugin/i18n/resources/en_US.all.json", size: 395999, mode: os.FileMode(438), modTime: time.Unix(1701468645, 0)} + info := bindataFileInfo{name: "plugin/i18n/resources/en_US.all.json", size: 395999, mode: os.FileMode(438), modTime: time.Unix(1701463726, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -132,7 +132,7 @@ func pluginI18nResourcesEs_esAllJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "plugin/i18n/resources/es_ES.all.json", size: 424563, mode: os.FileMode(438), modTime: time.Unix(1701468645, 0)} + info := bindataFileInfo{name: "plugin/i18n/resources/es_ES.all.json", size: 424563, mode: os.FileMode(438), modTime: time.Unix(1701463726, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -152,7 +152,7 @@ func pluginI18nResourcesFr_frAllJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "plugin/i18n/resources/fr_FR.all.json", size: 428810, mode: os.FileMode(438), modTime: time.Unix(1701468645, 0)} + info := bindataFileInfo{name: "plugin/i18n/resources/fr_FR.all.json", size: 428810, mode: os.FileMode(438), modTime: time.Unix(1701463726, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -172,7 +172,7 @@ func pluginI18nResourcesIt_itAllJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "plugin/i18n/resources/it_IT.all.json", size: 419594, mode: os.FileMode(438), modTime: time.Unix(1701468645, 0)} + info := bindataFileInfo{name: "plugin/i18n/resources/it_IT.all.json", size: 419594, mode: os.FileMode(438), modTime: time.Unix(1701463726, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -192,7 +192,7 @@ func pluginI18nResourcesJa_jpAllJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "plugin/i18n/resources/ja_JP.all.json", size: 462272, mode: os.FileMode(438), modTime: time.Unix(1701468645, 0)} + info := bindataFileInfo{name: "plugin/i18n/resources/ja_JP.all.json", size: 462272, mode: os.FileMode(438), modTime: time.Unix(1701463726, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -212,7 +212,7 @@ func pluginI18nResourcesKo_krAllJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "plugin/i18n/resources/ko_KR.all.json", size: 424966, mode: os.FileMode(438), modTime: time.Unix(1701468645, 0)} + info := bindataFileInfo{name: "plugin/i18n/resources/ko_KR.all.json", size: 424966, mode: os.FileMode(438), modTime: time.Unix(1701463726, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -232,7 +232,7 @@ func pluginI18nResourcesPt_brAllJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "plugin/i18n/resources/pt_BR.all.json", size: 417519, mode: os.FileMode(438), modTime: time.Unix(1701468645, 0)} + info := bindataFileInfo{name: "plugin/i18n/resources/pt_BR.all.json", size: 417519, mode: os.FileMode(438), modTime: time.Unix(1701463726, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -252,7 +252,7 @@ func pluginI18nResourcesZh_hansAllJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "plugin/i18n/resources/zh_Hans.all.json", size: 389271, mode: os.FileMode(438), modTime: time.Unix(1701468645, 0)} + info := bindataFileInfo{name: "plugin/i18n/resources/zh_Hans.all.json", size: 389271, mode: os.FileMode(438), modTime: time.Unix(1701463726, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -272,7 +272,7 @@ func pluginI18nResourcesZh_hantAllJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "plugin/i18n/resources/zh_Hant.all.json", size: 392417, mode: os.FileMode(438), modTime: time.Unix(1701468645, 0)} + info := bindataFileInfo{name: "plugin/i18n/resources/zh_Hant.all.json", size: 392417, mode: os.FileMode(438), modTime: time.Unix(1701463726, 0)} a := &asset{bytes: bytes, info: info} return a, nil }