From 8023432533cec736423a7f8cfbcf2f9554e5f50c Mon Sep 17 00:00:00 2001 From: yuanyu Date: Fri, 28 Oct 2022 09:38:05 +0800 Subject: [PATCH] 1.Change to lower case 2.Add digital judgment --- delfin/drivers/hpe/hpe_3par/component_handler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/delfin/drivers/hpe/hpe_3par/component_handler.py b/delfin/drivers/hpe/hpe_3par/component_handler.py index 8be778565..66dd7ff82 100644 --- a/delfin/drivers/hpe/hpe_3par/component_handler.py +++ b/delfin/drivers/hpe/hpe_3par/component_handler.py @@ -63,7 +63,7 @@ def get_storage(self, context): # Check the hardware and software health # status of the storage system re_str = self.ssh_handler.get_health_state() - if 'degraded' in re_str or 'failed' in re_str: + if 'degraded' in re_str.lower() or 'failed' in re_str.lower(): status = constants.StorageStatus.ABNORMAL except Exception: status = constants.StorageStatus.ABNORMAL @@ -287,7 +287,7 @@ def list_disks(self, storage_id): model = inventory_map.get('disk_model') firmware = inventory_map.get('disk_fw_rev') speed = None - if disk.get('rpm'): + if str(disk.get('rpm')).isdigit(): speed = int(disk.get('rpm')) * units.k disk_model = { 'name': disk.get('cagepos'),