From 99b4b5e9db1dd067c5574deaab3f2d0868328582 Mon Sep 17 00:00:00 2001 From: Kurt Kanaskie Date: Thu, 23 May 2024 18:31:43 -0400 Subject: [PATCH] bug: fix organization import errors (#471) --- internal/client/apps/apps.go | 2 +- internal/cmd/org/import.go | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/client/apps/apps.go b/internal/client/apps/apps.go index 48631c67c..fa53e0f67 100644 --- a/internal/client/apps/apps.go +++ b/internal/client/apps/apps.go @@ -492,7 +492,7 @@ func createAsyncApp(app application, developerEntities developers.Appdevelopers, temporaryCredential := newAppCredentials[0].(map[string]interface{}) apiclient.ClientPrintHttpResponse.Set(false) - _, err = DeleteKey(developerEmail, newDeveloperApp["name"].(string), temporaryCredential["consumerKey"].(string)) + _, err = DeleteKey(url.QueryEscape(developerEmail), newDeveloperApp["name"].(string), temporaryCredential["consumerKey"].(string)) apiclient.ClientPrintHttpResponse.Set(apiclient.GetCmdPrintHttpResponseSetting()) if err != nil { clilog.Error.Println(err) diff --git a/internal/cmd/org/import.go b/internal/cmd/org/import.go index ca8654308..f1fbaa72c 100644 --- a/internal/cmd/org/import.go +++ b/internal/cmd/org/import.go @@ -77,9 +77,9 @@ var ImportCmd = &cobra.Command{ clilog.Info.Println("Check for files with KVM Entries") orgKVMFileList, envKVMFileList, _, _ := utils.ListKVMFiles(folder) - if utils.FileExists(path.Join(folder, "org_"+org+utils.DefaultFileSplitter+kvmFileName)) { + if utils.FileExists(path.Join(folder, org+utils.DefaultFileSplitter+kvmFileName)) { clilog.Info.Println("Importing Org scoped KVMs...") - if kvmList, err = utils.ReadEntityFile(path.Join(folder, "org_"+org+utils.DefaultFileSplitter+kvmFileName)); err != nil { + if kvmList, err = utils.ReadEntityFile(path.Join(folder, org+utils.DefaultFileSplitter+kvmFileName)); err != nil { return err } for _, kvmName := range kvmList { @@ -181,9 +181,9 @@ var ImportCmd = &cobra.Command{ } } - if utils.FileExists(path.Join(folder, "env_"+environment+utils.DefaultFileSplitter+kvmFileName)) { + if utils.FileExists(path.Join(folder, environment+utils.DefaultFileSplitter+kvmFileName)) { clilog.Info.Println("\tImporting KVM Names only...") - if kvmList, err = utils.ReadEntityFile(path.Join(folder, "env_"+environment+utils.DefaultFileSplitter+kvmFileName)); err != nil { + if kvmList, err = utils.ReadEntityFile(path.Join(folder, environment+utils.DefaultFileSplitter+kvmFileName)); err != nil { return err } for _, kvmName := range kvmList { @@ -235,7 +235,7 @@ func init() { ImportCmd.Flags().IntVarP(&conn, "conn", "c", 4, "Number of connections") ImportCmd.Flags().StringVarP(&folder, "folder", "f", - "", "folder containing API proxy bundles") + "", "folder containing organization resources from prior export") ImportCmd.Flags().BoolVarP(&importTrace, "import-trace", "", false, "Import distributed trace configuration; default false") ImportCmd.Flags().BoolVarP(&importDebugmask, "import-debugmask", "",