1
0
mirror of https://github.com/rancher/os.git synced 2025-09-12 13:17:17 +00:00

Trim whitespace for lists from rancherctl config set

This commit is contained in:
Darren Shepherd
2015-04-09 23:20:05 -07:00
parent b6d3b1bccb
commit 7495f5e77f

View File

@@ -54,7 +54,11 @@ func getOrSetVal(args string, data map[interface{}]interface{}, value interface{
func DummyMarshall(value string) interface{} {
if strings.HasPrefix(value, "[") && strings.HasSuffix(value, "]") {
return strings.Split(value[1:len(value)-1], ",")
result := []string{}
for _, i := range strings.Split(value[1:len(value)-1], ",") {
result = append(result, strings.TrimSpace(i))
}
return result
}
if value == "true" {