diff --git a/README.md b/README.md index ba269b6..474ec21 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,6 @@ The goal is to generate an existing infrastructure on Netbox and have the abilit * The project is only compatible with Linux. Since it uses `ethtool` and parses `/sys/` directory, it's not compatible with *BSD distributions. -* Netbox `>=2.6.0,<=2.6.2` has a caching problem ; if the cache lifetime is too high, the script can get stale data after modification. # Configuration diff --git a/netbox_agent/ethtool.py b/netbox_agent/ethtool.py index 91522c9..3ce3fbc 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,6 @@ class Ethtool(): def parse(self): if which('ethtool') is None: return None - return { - **self._parse_ethtool_output(), - **self._parse_ethtool_module_output(), - } + output = self._parse_ethtool_output() + output.update(self._parse_ethtool_module_output()) + return output