be python3.5 compatible

This commit is contained in:
Solvik Blum 2019-08-06 18:15:08 +02:00
parent 99c205ca65
commit a22b648b8a
No known key found for this signature in database
GPG key ID: CC12B3DC262B6C47

View file

@ -19,6 +19,12 @@ field_map = {
}
def merge_two_dicts(x, y):
z = x.copy()
z.update(y)
return z
class Ethtool():
"""
This class aims to parse ethtool output
@ -67,7 +73,8 @@ class Ethtool():
def parse(self):
if which('ethtool') is None:
return None
return {
**self._parse_ethtool_output(),
**self._parse_ethtool_module_output(),
}
# TODO >= py35: return {**a, **b}
return merge_two_dicts(
self._parse_ethtool_output(),
self._parse_ethtool_module_output()
)