From 01e3d935a34f38e48364724da1cad7cbbb18576e Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Tue, 3 Nov 2020 18:22:55 +0100 Subject: wireless: T3042: move wifi-regulatory-domain into individual interface definition --- src/migration-scripts/interfaces/13-to-14 | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/migration-scripts/interfaces') diff --git a/src/migration-scripts/interfaces/13-to-14 b/src/migration-scripts/interfaces/13-to-14 index 545b57ab2..fc6d7f443 100755 --- a/src/migration-scripts/interfaces/13-to-14 +++ b/src/migration-scripts/interfaces/13-to-14 @@ -14,7 +14,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# Rename Wireless interface security mode 'both' to 'wpa+wpa2' +# T3043: rename Wireless interface security mode 'both' to 'wpa+wpa2' +# T3043: move "system wifi-regulatory-domain" to indicidual wireless interface import os @@ -36,6 +37,12 @@ if __name__ == '__main__': # Nothing to do exit(0) + country_code = '' + cc_cli = ['system', 'wifi-regulatory-domain'] + if config.exists(cc_cli): + country_code = config.return_value(cc_cli) + config.delete(cc_cli) + for wifi in config.list_nodes(base): sec_mode = base + [wifi, 'security', 'wpa', 'mode'] if config.exists(sec_mode): @@ -43,6 +50,9 @@ if __name__ == '__main__': if mode == 'both': config.set(sec_mode, value='wpa+wpa2', replace=True) + if country_code: + config.set(base + [wifi, 'country-code'], value=country_code) + try: with open(file_name, 'w') as f: f.write(config.to_string()) -- cgit v1.2.3