diff --git a/delfin/drivers/dell_emc/scaleio/rest_handler.py b/delfin/drivers/dell_emc/scaleio/rest_handler.py index 4c8d954b4..f9675b492 100644 --- a/delfin/drivers/dell_emc/scaleio/rest_handler.py +++ b/delfin/drivers/dell_emc/scaleio/rest_handler.py @@ -248,12 +248,13 @@ def list_alerts(self, query_para=None): if not alert_util.is_alert_in_time_range(query_para, alert_time): continue + alert_type = json_alert.get('alertType') alert_model = { 'alert_id': json_alert.get('id'), - 'alert_name': json_alert.get('name'), + 'alert_name': alert_type + json_alert.get('name'), 'severity': json_alert.get('severity'), 'category': constants.Category.FAULT, - 'type': json_alert.get('alertType'), + 'type': alert_type, 'sequence_number': json_alert.get('uuid'), 'description': json_alert.get('alertType'), 'occur_time': alert_time, @@ -277,7 +278,10 @@ def list_storage_host_initiators(self, storage_id): consts.REST_SCALIO_INITIIATORS) for initiators_json in (storage_initiators or []): status = initiators_json.get('mdmConnectionState') - initiators_id = initiators_json['id'] + initiators_id = initiators_json.get('id') + initiators_type = constants.InitiatorType.UNKNOWN + if 'iscsi' in initiators_json.get('perfProfile'): + initiators_type = constants.InitiatorType.ISCSI if 'Connected' == status: status = constants.HostStatus.NORMAL elif 'Disconnected' == status: @@ -287,6 +291,7 @@ def list_storage_host_initiators(self, storage_id): "storage_id": storage_id, "native_storage_host_initiator_id": initiators_id, "wwn": initiators_id, + "type": initiators_type, "status": status, "native_storage_host_id": initiators_json.get( 'protectionDomainId'), diff --git a/delfin/tests/unit/drivers/dell_emc/scaleio/test_constans.py b/delfin/tests/unit/drivers/dell_emc/scaleio/test_constans.py index e03a3b11b..ccfd5a81f 100644 --- a/delfin/tests/unit/drivers/dell_emc/scaleio/test_constans.py +++ b/delfin/tests/unit/drivers/dell_emc/scaleio/test_constans.py @@ -1062,7 +1062,7 @@ SYSTEM_ALERT = [ { 'alert_id': '31d682d5-e696-466e-990a-57d0f9616b21', - 'alert_name': '31d682d5-e696-466e-990a-57d0f9616b21', + 'alert_name': 'TRIAL_LICENSE_USED31d682d5-e696-466e-990a-57d0f9616b21', 'severity': 'ALERT_LOW', 'category': 'Fault', 'type': 'TRIAL_LICENSE_USED',