From 68b993d70470e87dc6cccba4b89b04e16f36675c Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Sat, 10 Jul 2021 12:10:48 +0200 Subject: pyExporter: Fix getting IPCP address This also fixes no neighbors shown. --- exporters-influxdb/pyExporter/oexport.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'exporters-influxdb') diff --git a/exporters-influxdb/pyExporter/oexport.py b/exporters-influxdb/pyExporter/oexport.py index c7bf3f4..0df3bb1 100755 --- a/exporters-influxdb/pyExporter/oexport.py +++ b/exporters-influxdb/pyExporter/oexport.py @@ -203,9 +203,15 @@ class OuroborosRIBReader: def _get_address_for_ipcp(self, ipcp_name): - _dir = self._get_dt_dir_for_ipcp(ipcp_name) - if _dir and len(_dir) > 3: - return _dir[3:] + path = self._get_dir_for_ipcp(ipcp_name) + try: + _subdirs = [f.name for f in os.scandir(path)] + except IOError as _: + return None + + for _dir in _subdirs: + if len(_dir) > 3 and _dir[:3] == 'dt.': + return _dir[3:] return None -- cgit v1.2.3