Skip to content

Commit 00edff1

Browse files
author
Ritwick DSouza
committed
[raspbian] Fixed isort and flake8 errors
1 parent 2585bfa commit 00edff1

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

netjsonconfig/backends/raspbian/converters.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ def to_intermediate(self):
4141
if addresses is not None:
4242
for address in addresses:
4343
new_address = {}
44-
print address
4544
if iftype in ['ethernet', 'bridge', 'loopback']:
4645
if address.get('proto') == 'static':
4746
if address.get('family') == 'ipv4':
@@ -93,7 +92,7 @@ def to_intermediate(self):
9392
result = []
9493
interfaces = get_copy(self.netjson, self.netjson_key)
9594
for interface in interfaces:
96-
if interface['type'] == 'wireless' and interface.get('wireless').get('mode') is not 'adhoc' :
95+
if interface['type'] == 'wireless' and interface.get('wireless').get('mode') is not 'adhoc':
9796
new_interface = {
9897
'ifname': interface.get('name'),
9998
'iftype': interface.get('type'),
@@ -133,7 +132,7 @@ def _get_encryption(self, wireless):
133132
return {}
134133
disabled = encryption.get('disabled', False)
135134
new_encryption = {}
136-
if encryption.get('protocol') is not 'none' and encryption.get('disabled') is not True:
135+
if encryption.get('protocol') is not 'none' and disabled is not True:
137136
protocol, method = encryption.get('protocol').split("_")
138137
if protocol in ['wpa', 'wpa2']:
139138
auth_algs = '1'
@@ -151,6 +150,7 @@ def _get_encryption(self, wireless):
151150
new_encryption.update({'wpa_pairwise': wpa_pairwise})
152151
return new_encryption
153152

153+
154154
class DnsServers(BaseConverter):
155155
netjson_key = 'dns_servers'
156156

tests/raspbian/test_interfaces.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,10 @@ def test_adhoc_wireless(self):
343343
wireless-channel 1
344344
wireless-essid freifunk
345345
wireless-mode ad-hoc
346+
346347
'''
348+
self.assertEqual(o.render(), expected)
349+
347350
def test_simple_bridge(self):
348351
o = Raspbian({
349352
"interfaces": [

0 commit comments

Comments
 (0)