1
0
mirror of https://github.com/rancher/os.git synced 2025-09-05 16:52:20 +00:00

Fix ros config set for list values

This commit is contained in:
Darren Shepherd
2016-02-10 14:40:51 -07:00
parent da7abd871e
commit 6f98e06d97
2 changed files with 16 additions and 1 deletions

View File

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

View File

@@ -34,3 +34,18 @@ ip link show dev eth7 | grep 'master bond0'
SCRIPT
sudo bash test-merge
'''.strip())
def test_network_dns_ros_set(qemu):
SSH(qemu).check_call('bash', '-c', '''
set -x -e
sudo ros config set rancher.network.dns.search '[a,b]'
if [ "$(sudo ros config get rancher.network.dns.search)" == "- a
- b
" ]; then
sudo ros config get rancher.network.dns.search
exit 1
fi
'''.strip())