Skip to content

Commit 27807bf

Browse files
committed
[deps] Upgraded to openwisp-utils 1.0.x
Also updated to latest version of the black formatter.
1 parent ef8b344 commit 27807bf

7 files changed

Lines changed: 18 additions & 9 deletions

File tree

netjsonconfig/backends/openvpn/openvpn.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,10 @@ def _auto_client_files(
148148
if key_path and key_contents:
149149
client['key'] = key_path
150150
files.append(
151-
dict(path=key_path, contents=key_contents, mode=X509_FILE_MODE,)
151+
dict(
152+
path=key_path,
153+
contents=key_contents,
154+
mode=X509_FILE_MODE,
155+
)
152156
)
153157
return files

netjsonconfig/backends/openwrt/converters/default.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
class Default(OpenWrtConverter):
99
@classmethod
1010
def should_run_forward(cls, config):
11-
""" Always runs """
11+
"""Always runs"""
1212
return True
1313

1414
@classmethod
1515
def should_run_backward(cls, intermediate_data):
16-
""" Always runs """
16+
"""Always runs"""
1717
return True
1818

1919
def to_intermediate(self):

netjsonconfig/exceptions.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ class NetJsonConfigException(Exception):
2020
"""
2121

2222
def __str__(self):
23-
message = "%s %s\n" % (self.__class__.__name__, self.details,)
23+
message = "%s %s\n" % (
24+
self.__class__.__name__,
25+
self.details,
26+
)
2427
errors = _list_errors(self.details)
2528
separator = '\nAgainst schema %s\n%s\n'
2629
details = reduce(lambda x, y: x + separator % y, errors, '')

requirements-test.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ coveralls
33
sphinx
44
sphinx_rtd_theme
55
# commit message style check
6-
openwisp-utils[qa]~=0.7.0
6+
openwisp-utils[qa]~=1.0.0

tests/openwisp/test_backend.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ def test_cron(self):
229229
tar.close()
230230

231231
def test_checksum(self):
232-
""" ensures checksum of same config doesn't change """
232+
"""ensures checksum of same config doesn't change"""
233233
o = OpenWisp({"general": {"hostname": "test"}})
234234
# md5 is good enough and won't slow down test execution too much
235235
checksum1 = md5(o.generate().getvalue()).hexdigest()

tests/openwrt/test_backend.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ def test_file_schema(self):
358358
o.validate()
359359

360360
def test_checksum(self):
361-
""" ensures checksum of same config doesn't change """
361+
"""ensures checksum of same config doesn't change"""
362362
o = OpenWrt({"general": {"hostname": "test"}})
363363
# md5 is good enough and won't slow down test execution too much
364364
checksum1 = md5(o.generate().getvalue()).hexdigest()

tests/test_bin.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,10 @@ def test_valid_arg(self):
141141
],
142142
}
143143
)
144-
command = "netjsonconfig --config '{0}' -b openwrt -m render -a files=False".format(
145-
config
144+
command = (
145+
"netjsonconfig --config '{0}' -b openwrt -m render -a files=False".format(
146+
config
147+
)
146148
)
147149
output = subprocess.check_output(command, shell=True).decode()
148150
self.assertNotIn('test.txt', output)

0 commit comments

Comments
 (0)