luci-mod-network: split config migration into 2 steps
authorRafał Miłecki <rafal@milecki.pl>
Sat, 29 May 2021 15:19:02 +0000 (17:19 +0200)
committerRafał Miłecki <rafal@milecki.pl>
Sat, 29 May 2021 16:19:54 +0000 (18:19 +0200)
commit09329fe7bb6571032570b21541c1991a3443cc07
treea8230fb31dd52269a7a15351cd7b1ab318b7e7f2
parent14511e5392b6df20bb32aedebd89f32a1f6722da
luci-mod-network: split config migration into 2 steps

Problem with handling all migrations in 1 step is that uci.sections()
doesn't include changes queued using uci.callAdd() and uci.callSet().
That could result in unexpected behaviour and generating invalid
configs.

For the sake of simplicity and reliability use 2 steps migration. The
downside is that users may get prompted twice to migrate.

Reported-by: Hauke Mehrtens <hauke@hauke-m.de>
Fixes: 74be304e541f ("treewide: use "device" option in UCI "interface" sections")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Tested-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit e7c9c63c657963daa1a0d57dcb0848d88e909c25)
modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js