Skip to content

Commit

Permalink
Merge pull request #585 from yuanyu-ghca/hpe_3par_20221028
Browse files Browse the repository at this point in the history
Change to lower case and add digital judgment
  • Loading branch information
yuanyu-ghca authored Oct 28, 2022
2 parents f5b25eb + 8023432 commit dff317c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions delfin/drivers/hpe/hpe_3par/component_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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'),
Expand Down

0 comments on commit dff317c

Please sign in to comment.