File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -108,7 +108,7 @@ func migrateConfig(filename string) error {
108108 return err
109109 }
110110
111- var hosts map [string ][]map [ string ] string
111+ var hosts map [string ][]yaml. Node
112112 err = yaml .Unmarshal (b , & hosts )
113113 if err != nil {
114114 return fmt .Errorf ("error decoding legacy format: %w" , err )
@@ -119,8 +119,9 @@ func migrateConfig(filename string) error {
119119 if len (entries ) < 1 {
120120 continue
121121 }
122- for key , value := range entries [0 ] {
123- if err := cfg .Set (hostname , key , value ); err != nil {
122+ mapContent := entries [0 ].Content
123+ for i := 0 ; i < len (mapContent )- 1 ; i += 2 {
124+ if err := cfg .Set (hostname , mapContent [i ].Value , mapContent [i + 1 ].Value ); err != nil {
124125 return err
125126 }
126127 }
You can’t perform that action at this time.
0 commit comments