From 0632a4f90e79fdef537fdd375875a4b2456575cf Mon Sep 17 00:00:00 2001 From: tanjy Date: Wed, 12 Jan 2022 15:35:16 +0800 Subject: [PATCH] change svc fc port id --- delfin/drivers/ibm/storwize_svc/ssh_handler.py | 6 +++--- .../unit/drivers/ibm/storwize_svc/test_ibm_storwize_svc.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/delfin/drivers/ibm/storwize_svc/ssh_handler.py b/delfin/drivers/ibm/storwize_svc/ssh_handler.py index 8d05280be..f8fed1c9d 100644 --- a/delfin/drivers/ibm/storwize_svc/ssh_handler.py +++ b/delfin/drivers/ibm/storwize_svc/ssh_handler.py @@ -577,7 +577,7 @@ def get_fc_port(self, storage_id): port_result = { 'name': location, 'storage_id': storage_id, - 'native_port_id': location, + 'native_port_id': port_map.get('id'), 'location': location, 'connection_status': conn_status, 'health_status': status, @@ -748,7 +748,7 @@ def packege_data(self, storage_id, resource_type, metrics, metric_map): resource_info).get('iops').get(iops_time) res_value = \ res_value / iops_value if iops_value else 0 - res_value = round(res_value, 2) + res_value = round(res_value, 3) metric_map[resource_info][target][res_time] = \ res_value break @@ -785,7 +785,7 @@ def count_metric_data(last_data, now_data, interval, target, metric_type, elif 'IOPS' in metric_type.upper() or 'RESPONSETIME' \ in metric_type.upper(): value = value / interval - value = round(value, 2) + value = round(value, 3) if metric_map.get(res_id): if metric_map.get(res_id).get(metric_type): if metric_map.get(res_id).get(metric_type).get( diff --git a/delfin/tests/unit/drivers/ibm/storwize_svc/test_ibm_storwize_svc.py b/delfin/tests/unit/drivers/ibm/storwize_svc/test_ibm_storwize_svc.py index 0636932fc..ea62646c0 100644 --- a/delfin/tests/unit/drivers/ibm/storwize_svc/test_ibm_storwize_svc.py +++ b/delfin/tests/unit/drivers/ibm/storwize_svc/test_ibm_storwize_svc.py @@ -1076,7 +1076,7 @@ def __init__(self): { 'name': 'node1_0', 'storage_id': '12345', - 'native_port_id': 'node1_0', + 'native_port_id': '0', 'location': 'node1_0', 'connection_status': 'connected', 'health_status': 'normal',