Skip to content

Commit

Permalink
Merge branch 'master' into pure_2022
Browse files Browse the repository at this point in the history
  • Loading branch information
tanjiangyu-ghca authored Jan 7, 2022
2 parents 025039e + 6777776 commit 09be3da
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
18 changes: 16 additions & 2 deletions delfin/drivers/dell_emc/vplex/vplex_stor.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ def get_storage(self, context):
attr_map = VplexStorageDriver.get_attribute_map(response)
operate_status = attr_map.get('operational-status')
health_status = attr_map.get('health-state')
status = VplexStorageDriver.analyse_status(operate_status,
health_status)
status = VplexStorageDriver.analyse_storage_status(
operate_status, health_status)
try:
raw_capacity = self.get_cluster_raw_capacity(cluster_name)
total_capacity = self.get_cluster_total_capacity(
Expand Down Expand Up @@ -227,6 +227,20 @@ def analyse_status(operational_status, health_status):
status = constants.StorageStatus.OFFLINE
return status

@staticmethod
def analyse_storage_status(operational_status, health_status):
status = constants.StorageStatus.ABNORMAL
status_normal = ["ok"]
status_offline = ["unknown", "isolated", "not-running",
"non-recoverable-error"]
if operational_status == constants.StorageStatus.DEGRADED:
status = constants.StorageStatus.DEGRADED
elif operational_status and health_status in status_normal:
status = constants.StorageStatus.NORMAL
elif operational_status and health_status in status_offline:
status = constants.StorageStatus.OFFLINE
return status

@staticmethod
def analyse_vv_type(thin_enabled):
rs_type = constants.VolumeType.THICK
Expand Down
2 changes: 1 addition & 1 deletion delfin/tests/unit/drivers/dell_emc/vplex/test_emc_vplex.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@
'name': 'cluster-1',
'vendor': 'DELL EMC',
'description': 'EMC VPlex Storage',
'status': 'abnormal',
'status': 'degraded',
'serial_number': 'FNM00000000000',
'firmware_version': ' 6.1.0.01.00.13',
'model': 'EMC VPLEX Local',
Expand Down

0 comments on commit 09be3da

Please sign in to comment.