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:
@@ -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))
|
||||
}
|
||||
|
@@ -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())
|
||||
|
Reference in New Issue
Block a user