RDC Prometheus plugin return errors when use the --rdc_gpu_indexes

When above option is used, the plugin returns errors:
  result = rdc.rdc_group_gpu_add(rdc_handle, gpu_group_id, gpu)
  ctypes.ArgumentError: argument 3: <type 'exceptions.TypeError'>: wrong type

The rdc_prometheus.py is changed to convert string to integer.
The RdcUtil.py is also changed to raise Exception properly.

Change-Id: I9535091ff1fc8882cccd32e5f2810da5241768c3
This commit is contained in:
Bill(Shuzhou) Liu authored and Shuzhou Liu committed 2021-02-23 14:15:04 -05:00
1 orang tua 26b32f5a08
melakukan 7ca7a571a7
2 files changed
+7 -4

No files matched your search

+3
Melihat File
@@ -88,6 +88,9 @@ if __name__ == '__main__':
rdc_ip_port = args.rdc_ip_port
if args.rdc_embedded:
rdc_ip_port = None
if args.rdc_gpu_indexes != None:
for i in range(0, len(args.rdc_gpu_indexes)):
args.rdc_gpu_indexes[i] = int(args.rdc_gpu_indexes[i])
reader = PrometheusReader(rdc_ip_port, field_ids, args.rdc_update_freq*1000000,
args.rdc_max_keep_age, args.rdc_max_keep_samples,