Skip to content

Commit

Permalink
Fixed 'tx_power' KeyError, introduced in 71b083e #37
Browse files Browse the repository at this point in the history
  • Loading branch information
nemesifier committed Feb 19, 2016
1 parent 007da6e commit 2c1e72e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 3 additions & 2 deletions netjsonconfig/backends/openwrt/renderers.py
Expand Up @@ -224,8 +224,9 @@ def _get_radios(self):
for radio in radios:
uci_radio = radio.copy()
# rename tx_power to txpower
uci_radio['txpower'] = radio['tx_power']
del uci_radio['tx_power']
if 'tx_power' in radio:
uci_radio['txpower'] = radio['tx_power']
del uci_radio['tx_power']
# rename driver to type
uci_radio['type'] = radio['driver']
del uci_radio['driver']
Expand Down
2 changes: 0 additions & 2 deletions tests/openwrt/test_wireless.py
Expand Up @@ -21,7 +21,6 @@ def test_radio(self):
"protocol": "802.11n",
"channel": 140,
"channel_width": 20,
"tx_power": 9,
"country": "en"
},
{
Expand All @@ -45,7 +44,6 @@ def test_radio(self):
option htmode 'HT20'
option hwmode '11a'
option phy 'phy0'
option txpower '9'
option type 'mac80211'
config wifi-device 'radio1'
Expand Down

0 comments on commit 2c1e72e

Please sign in to comment.