/bin/wifi: Delete old band's options when switching bands on Camaro.
Fixes b/23766883...again. The original fix [1] only applied to 'wifi
set'. This also fixes it for 'wifi setclient'.
Change-Id: If0d041169c8d20b6999225e68ebffaa9c51d8a98
1: go/fibercl/66694; commit 540fa60391f6d98308746ff83ffbfa03b5d651bd
diff --git a/wifi/wifi.py b/wifi/wifi.py
index 57ec4cd..8f6fb7d 100755
--- a/wifi/wifi.py
+++ b/wifi/wifi.py
@@ -937,17 +937,15 @@
success = function(opt)
if success:
- if extra[0] == 'set':
+ if extra[0] in ('set', 'setclient'):
+ program = 'hostapd' if extra[0] == 'set' else 'wpa_supplicant'
if opt.persist:
phy = iw.find_phy(opt.band, opt.channel)
for band in iw.phy_bands(phy):
if band != opt.band:
- persist.delete_options('hostapd', band)
- persist.save_options('hostapd', opt.band, argv)
- persist.save_options('hostapd', opt.band, argv, tmp=True)
-
- if extra[0] == 'setclient' and opt.persist:
- persist.save_options('wpa_supplicant', opt.band, argv)
+ persist.delete_options(program, band)
+ persist.save_options(program, opt.band, argv)
+ persist.save_options(program, opt.band, argv, tmp=True)
return success