be python3.5 compatible
This commit is contained in:
parent
99c205ca65
commit
a22b648b8a
1 changed files with 11 additions and 4 deletions
|
@ -19,6 +19,12 @@ field_map = {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def merge_two_dicts(x, y):
|
||||||
|
z = x.copy()
|
||||||
|
z.update(y)
|
||||||
|
return z
|
||||||
|
|
||||||
|
|
||||||
class Ethtool():
|
class Ethtool():
|
||||||
"""
|
"""
|
||||||
This class aims to parse ethtool output
|
This class aims to parse ethtool output
|
||||||
|
@ -67,7 +73,8 @@ class Ethtool():
|
||||||
def parse(self):
|
def parse(self):
|
||||||
if which('ethtool') is None:
|
if which('ethtool') is None:
|
||||||
return None
|
return None
|
||||||
return {
|
# TODO >= py35: return {**a, **b}
|
||||||
**self._parse_ethtool_output(),
|
return merge_two_dicts(
|
||||||
**self._parse_ethtool_module_output(),
|
self._parse_ethtool_output(),
|
||||||
}
|
self._parse_ethtool_module_output()
|
||||||
|
)
|
||||||
|
|
Loading…
Reference in a new issue