aboutsummaryrefslogtreecommitdiff
path: root/exporters-influxdb/pyExporter
diff options
context:
space:
mode:
Diffstat (limited to 'exporters-influxdb/pyExporter')
-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