Skip to content

Commit d399381

Browse files
authored
Merge pull request #162 from Helene/in_memory
Fix substring search for appending '-ar' option in zimon Query
2 parents 3b191a8 + b0ce346 commit d399381

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

source/queryHandler/Query.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -189,16 +189,19 @@ def addMeasurement(self, meassure):
189189
def __str__(self):
190190
# dd = '-a' if self.includeDiskData else ''
191191
# Workaround for RTC Defect 280368: Zimon capacity query does not return all results (seen on CNSA)
192-
if (self.metrics
193-
and any(str(metric) in self.DISK_CAP_METRICS for metric in self.metrics)
194-
) or (self.sensor
195-
and self.sensor in ("GPFSDiskCap", "GPFSPoolCap", "GPFSInodeCap")
196-
):
197-
dd = '-ar'
198-
elif self.includeDiskData:
192+
dd = ''
193+
if self.includeDiskData:
199194
dd = '-a'
200-
else:
201-
dd = ''
195+
if self.metrics:
196+
for metric in self.metrics:
197+
if any(map(metric.__contains__, self.DISK_CAP_METRICS)):
198+
dd = '-ar'
199+
break
200+
elif (self.sensor and self.sensor in ("GPFSDiskCap",
201+
"GPFSPoolCap",
202+
"GPFSInodeCap")
203+
):
204+
dd = '-ar'
202205

203206
if self.rawData:
204207
raw = '-z'

0 commit comments

Comments
 (0)