This is an automated email from the ASF dual-hosted git repository.
rohit pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudstack-cloudmonkey.git
The following commit(s) were added to refs/heads/main by this push:
new c5054d8 Fix mapping of default output type to json (#93)
c5054d8 is described below
commit c5054d8964c58b32e349974592f742d254134430
Author: Pearl Dsilva <[email protected]>
AuthorDate: Mon Aug 9 16:16:43 2021 +0530
Fix mapping of default output type to json (#93)
---
cmd/output.go | 2 ++
config/config.go | 3 ++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/cmd/output.go b/cmd/output.go
index 3279c8c..f221e03 100644
--- a/cmd/output.go
+++ b/cmd/output.go
@@ -254,6 +254,8 @@ func printResult(outputType string, response
map[string]interface{}, filter []st
printCsv(response, filter)
case config.TABLE:
printTable(response, filter)
+ case config.DEFAULT:
+ printJSON(response)
default:
fmt.Println("Invalid output type configured, please fix that!")
}
diff --git a/config/config.go b/config/config.go
index 0e7e78e..5141df6 100644
--- a/config/config.go
+++ b/config/config.go
@@ -40,6 +40,7 @@ const (
JSON = "json"
TABLE = "table"
TEXT = "text"
+ DEFAULT= "default"
)
// ServerProfile describes a management server
@@ -75,7 +76,7 @@ type Config struct {
}
func GetOutputFormats() []string {
- return []string {"column", "csv", "json", "table", "text"}
+ return []string {"column", "csv", "json", "table", "text", "default"}
}
func CheckIfValuePresent(dataset []string, element string) bool {