@@ -23,31 +23,36 @@ def migrate(config: ConfigTree) -> None:
2323    for  type  in  config .list_nodes (['interfaces' ]):
2424        for  interface  in  config .list_nodes (['interfaces' , type ]):
2525            iface_base_path  =  ['interfaces' , type , interface ]
26-             dhcpv6_addr_path  =  iface_base_path  +  ['address' , 'dhcpv6' ]
27-             autoconf_path  =  iface_base_path  +  ['ipv6' , 'address' , 'autoconf' ]
28-             if  config .exists (dhcpv6_addr_path ) and  not  config .exists (autoconf_path ):
29-                 config .set (autoconf_path )
26+             dhcpv6_addr_path  =  iface_base_path  +  ['address' ]
27+ 
28+             if  config .exists (dhcpv6_addr_path ) and  'dhcpv6'  in  config .return_values (dhcpv6_addr_path ):
29+                 autoconf_path  =  iface_base_path  +  ['ipv6' , 'address' , 'autoconf' ]
30+                 if  not  config .exists (autoconf_path ):
31+                     config .set (autoconf_path )
3032
3133            vif_path  =  iface_base_path  +  ['vif' ]
3234            if  config .exists (vif_path ):
3335                for  vif  in  config .list_nodes (vif_path ):
3436                    vif_dhcpv6_addr_path  =  vif_path  +  [vif , 'address' ]
35-                     vif_autoconf_path  =  vif_path  +  [vif , 'ipv6' , 'address' , 'autoconf' ]
36-                     if  config .exists (vif_dhcpv6_addr_path ) and  not  config .exists (vif_autoconf_path ):
37-                         config .set (vif_autoconf_path )
37+                     if  config .exists (vif_dhcpv6_addr_path ) and  'dhcpv6'  in  config .return_values (vif_dhcpv6_addr_path ):
38+                         vif_autoconf_path  =  vif_path  +  [vif , 'ipv6' , 'address' , 'autoconf' ]
39+                         if  not  config .exists (vif_autoconf_path ):
40+                             config .set (vif_autoconf_path )
3841
3942            vif_s_path  =  iface_base_path  +  ['vif-s' ]
4043            if  config .exists (vif_s_path ):
4144                for  vif_s  in  config .list_nodes (vif_s_path ):
4245                    vif_s_dhcpv6_addr_path  =  vif_s_path  +  [vif_s , 'address' ]
43-                     vif_s_autoconf_path  =  vif_s_path  +  [vif_s , 'ipv6' , 'address' , 'autoconf' ]
44-                     if  config .exists (vif_s_dhcpv6_addr_path ) and  not  config .exists (vif_s_autoconf_path ):
45-                         config .set (vif_s_autoconf_path )
46+                     if  config .exists (vif_s_dhcpv6_addr_path ) and  'dhcpv6'  in  config .return_values (vif_s_dhcpv6_addr_path ):
47+                         vif_s_autoconf_path  =  vif_s_path  +  [vif_s , 'ipv6' , 'address' , 'autoconf' ]
48+                         if  not  config .exists (vif_s_autoconf_path ):
49+                             config .set (vif_s_autoconf_path )
4650
4751                    vif_c_path  =  iface_base_path  +  ['vif-s' , vif_s , 'vif-c' ]
4852                    if  config .exists (vif_c_path ):
4953                        for  vif_c  in  config .list_nodes (vif_c_path ):
5054                            vif_c_dhcpv6_addr_path  =  vif_c_path  +  [vif_c , 'address' ]
51-                             vif_c_autoconf_path  =  vif_c_path  +  [vif_c , 'ipv6' , 'address' , 'autoconf' ]
52-                             if  config .exists (vif_c_dhcpv6_addr_path ) and  not  config .exists (vif_c_autoconf_path ):
53-                                 config .set (vif_c_autoconf_path )
55+                             if  config .exists (vif_c_dhcpv6_addr_path ) and  'dhcpv6'  in  config .return_values (vif_c_dhcpv6_addr_path ):
56+                                 vif_c_autoconf_path  =  vif_c_path  +  [vif_c , 'ipv6' , 'address' , 'autoconf' ]
57+                                 if  not  config .exists (vif_c_autoconf_path ):
58+                                     config .set (vif_c_autoconf_path )
0 commit comments