aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri@ouroboros.rocks>2021-07-10 12:10:48 +0200
committerDimitri Staessens <dimitri@ouroboros.rocks>2021-07-10 12:10:48 +0200
commit68b993d70470e87dc6cccba4b89b04e16f36675c (patch)
tree3a1e27e35df57163e8de84d3efefa4782b70165c
parent84944bbd6973b446887dc5c778908db37b10cd6b (diff)
downloadouroboros-metrics-68b993d70470e87dc6cccba4b89b04e16f36675c.tar.gz
ouroboros-metrics-68b993d70470e87dc6cccba4b89b04e16f36675c.zip
pyExporter: Fix getting IPCP address
This also fixes no neighbors shown.
-rwxr-xr-xexporters-influxdb/pyExporter/oexport.py12
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