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
Этот коммит содержится в:
Bill(Shuzhou) Liu
2021-02-09 13:36:57 -05:00
коммит произвёл Shuzhou Liu
родитель 26b32f5a08
Коммит 7ca7a571a7
2 изменённых файлов: 7 добавлений и 4 удалений
+3
Просмотреть файл
@@ -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,