diff options
author | Dimitri Staessens <dimitri@ouroboros.rocks> | 2021-07-10 12:10:48 +0200 |
---|---|---|
committer | Dimitri Staessens <dimitri@ouroboros.rocks> | 2021-07-10 12:10:48 +0200 |
commit | 68b993d70470e87dc6cccba4b89b04e16f36675c (patch) | |
tree | 3a1e27e35df57163e8de84d3efefa4782b70165c /exporters-influxdb/pyExporter | |
parent | 84944bbd6973b446887dc5c778908db37b10cd6b (diff) | |
download | ouroboros-metrics-68b993d70470e87dc6cccba4b89b04e16f36675c.tar.gz ouroboros-metrics-68b993d70470e87dc6cccba4b89b04e16f36675c.zip |
pyExporter: Fix getting IPCP address
This also fixes no neighbors shown.
Diffstat (limited to 'exporters-influxdb/pyExporter')
-rwxr-xr-x | exporters-influxdb/pyExporter/oexport.py | 12 |
1 files changed, 9 insertions, 3 deletions
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 |