From a22b648b8a1e3e21968bedd6da6061c11f1e6aa1 Mon Sep 17 00:00:00 2001 From: Solvik Blum Date: Tue, 6 Aug 2019 18:15:08 +0200 Subject: [PATCH] be python3.5 compatible --- netbox_agent/ethtool.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/netbox_agent/ethtool.py b/netbox_agent/ethtool.py index 91522c9..36f10f4 100644 --- a/netbox_agent/ethtool.py +++ b/netbox_agent/ethtool.py @@ -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() + )