Skip to content

Commit

Permalink
[deps] Upgraded to openwisp-utils 1.0.x
Browse files Browse the repository at this point in the history
Also updated to latest version of the black formatter.
  • Loading branch information
nemesifier committed Feb 18, 2022
1 parent ef8b344 commit 27807bf
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 9 deletions.
6 changes: 5 additions & 1 deletion netjsonconfig/backends/openvpn/openvpn.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ def _auto_client_files(
if key_path and key_contents:
client['key'] = key_path
files.append(
dict(path=key_path, contents=key_contents, mode=X509_FILE_MODE,)
dict(
path=key_path,
contents=key_contents,
mode=X509_FILE_MODE,
)
)
return files
4 changes: 2 additions & 2 deletions netjsonconfig/backends/openwrt/converters/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
class Default(OpenWrtConverter):
@classmethod
def should_run_forward(cls, config):
""" Always runs """
"""Always runs"""
return True

@classmethod
def should_run_backward(cls, intermediate_data):
""" Always runs """
"""Always runs"""
return True

def to_intermediate(self):
Expand Down
5 changes: 4 additions & 1 deletion netjsonconfig/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ class NetJsonConfigException(Exception):
"""

def __str__(self):
message = "%s %s\n" % (self.__class__.__name__, self.details,)
message = "%s %s\n" % (
self.__class__.__name__,
self.details,
)
errors = _list_errors(self.details)
separator = '\nAgainst schema %s\n%s\n'
details = reduce(lambda x, y: x + separator % y, errors, '')
Expand Down
2 changes: 1 addition & 1 deletion requirements-test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ coveralls
sphinx
sphinx_rtd_theme
# commit message style check
openwisp-utils[qa]~=0.7.0
openwisp-utils[qa]~=1.0.0
2 changes: 1 addition & 1 deletion tests/openwisp/test_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def test_cron(self):
tar.close()

def test_checksum(self):
""" ensures checksum of same config doesn't change """
"""ensures checksum of same config doesn't change"""
o = OpenWisp({"general": {"hostname": "test"}})
# md5 is good enough and won't slow down test execution too much
checksum1 = md5(o.generate().getvalue()).hexdigest()
Expand Down
2 changes: 1 addition & 1 deletion tests/openwrt/test_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ def test_file_schema(self):
o.validate()

def test_checksum(self):
""" ensures checksum of same config doesn't change """
"""ensures checksum of same config doesn't change"""
o = OpenWrt({"general": {"hostname": "test"}})
# md5 is good enough and won't slow down test execution too much
checksum1 = md5(o.generate().getvalue()).hexdigest()
Expand Down
6 changes: 4 additions & 2 deletions tests/test_bin.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,10 @@ def test_valid_arg(self):
],
}
)
command = "netjsonconfig --config '{0}' -b openwrt -m render -a files=False".format(
config
command = (
"netjsonconfig --config '{0}' -b openwrt -m render -a files=False".format(
config
)
)
output = subprocess.check_output(command, shell=True).decode()
self.assertNotIn('test.txt', output)
Expand Down

0 comments on commit 27807bf

Please sign in to comment.