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

Merge pull request #757 from ibuildthecloud/fix-set-list

Fix ros config set for list values
This commit is contained in:
Ivan Mikushin
2016-02-11 10:22:21 -08:00
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())